
Microcontroller USB interfaces are a lot more complicated than simple serial ports. WaitingForFriday.com has an extensive overview of PIC USB, including hardware, firmware, and computer interface. The same USB PIC peripheral is used in the Infrared Toy and Open Logic Sniffer.
Via Hack a Day

Can’t we use the same code for PIC 24? Well, not exactly the same but a similar one.