PIC18F24K50 vendor-defined USB device using libusb, what is needed?
You may Refer to following link, it's for PIC24 but procedure may be same for PIC18 to use Microchip application libraries:

http://www.engscope.com/pic24-tutorial/14-3-setting-up-the-usb-framework/