Just look at the code for trinket m0, basically you are just pushing a payload and a few of bytes of code out of the usb port.Is there any examples where I can look for one for other chips?
https://github.com/lethevimlet/switch-trinket-m0/blob/master/main/main.ino