Well yeah, you're right! it does enumerates!!! and it even blink on my application.
What's happening, this is due to my programming setup and the specific hardwiring of the 18F1xK50. The USB lines D+/D- are shared with PGD and PGC, and it seems that in order for USB to work, the programmer has to be disconnected. For this purpose, I have purchased microchip special module for the 18F1xK50, that adapt the programming levels of the programmer to something that the PIC can accept, but at the same time allows to leave plugged the USB cable of the host computer by protecting the D+/D- lines from programming voltages.
Well I realized early on that it did not work, and I had to disconnect PGD and PGC in order to have USB working, so I added a set of switches on my programming cable.
Now I've been able to verify different behavior on USB programs, especially DT_HID260 which is the only one "powerful" enough to enumerate even with PGD/PGC connected to the programmer. All others required those lines disconnected to enumerate.
Now, about your little CDC routine, it does work well with PGD/PGC disconnected. But when I connect them back the USB connexion drops and the PIC crashes. No big deal, but I'll have to make sure that communication is established when servicing, and especially turn it of before unplugging USB.
Now I'll try to add USBIN/USBOUT statements and play a bit with communication before building the full program around it. Thanks for your great help!
Bookmarks