USB in User Mode
LibUSB library is best option for developing a USB driver. It can work on both Windows and Linux machines. It can be downloaded from http://libusb.sourceforge.net/. The full list of USB access functions offered by this library is available under the doc/ directory of LibUSB sources.
Architecture on Linux
The following is the detail design of using lib USB library with the user application on Linux machine.
Figure: Detail design of Lib USB with user mode application
Architecture on Windows Machine
Following is the architecture of using libusb on windows platform;
Figure: Detail design of LibUSB on Windows machine
The following code implements a user space code for detecting a USB device according to its class and getting its different manufacturing information from descriptors like device descriptors and interface descriptors.