Yep. That's the schematic. I'll let you work out the code.

I haven't done much with USB without the connection, but if I did, I would use a flag bit to indicate the 1st connection, jump to a routine and issue USBINIT, then toggle the flag bit once the USB connection was broken. That way I could issue the USBINIT only once when the connection was initially made.

You don't absolutely have to jump to a USBin or USBout routine unless you need to send/receive data over the USB port, BUT, you do need to use USBSERVICE frequently enough to keep the connection active.