I want to program a microcontroller (AVR) to control some leds through USB. It\'s just out of interest in how to build and program USB devices. There are some AVR microcontrolle
The Microsoft documentation area of the WDK (Windows Development Kit) is recently available on MSDN. There is a section on USB, though you would be best to read the earlier sections first, in particular the "Getting Started" areas. They assume you'll be using C as the programming language for driver development.
For Linux, the Linux USB website should be able to point you in the right direction. In particular you'll want the Programming Guide for Linux USB Device Drivers.