Snippet - Custom USB

Custom USB

I had been trying to get a snippet of code example, showing me how to create a custom USB device that will require me to install drivers on the target machine. The problem with much examples is that on the device side (on FEZ Panda II) the code was too simplified that I could not understand how to tune it to work with the windows application. I was also faced a problem with the USBC_Stream class created by GHI not working so I decided to find a way out. The result is this code.
The device lists as an ordinary USB device(not HID) and you have to install device drivers. (You can use LibUsbDotNet to generate driver files LibUsbDotNet C# USB Library download | will do the whole process later in another post, hopefully