I recently managed to implement an USB powered device using ATtiny2313 and V-USB library. As a beginner, I needed several evenings of research prior to the project so I decided to compile a tutorial covering the steps for building a simple USB device:
This first part covers the basics of getting USB connector to breadboard and using it to power a simple LED circuit. It can be extended to any USB-powered project.
The second part goes through rest of the test breadboard setup, including wiring the ATtiny2313 to the USB with proper pullups for a low-speed device on D+ and D-, as well as enabling the 12 MHz crystal.
The third part is the longest of the three and contains both device side and host side code, as well as a chapter on creating Windows drivers for V-USB devices using libusb-win32's INF-wizard.
Fourth part details how to send data from and to your device. It also wraps up the tutorial series and contains the source code and schematic as well as needed libraries and drivers for Windows in one neat package.
I'm using quite a lot of pictures so I put the tutorial to my blog, but would appreciate any comments, feedback and discussion here. The spark for my electronics hobby started here in AVRfreaks tutorial section, so I felt it was time to contribute something.
Update: Two new parts have been added, first for making a HID mouse, and second which goes through adapting the tutorial for use with zener diodes to run the AVR at 5 volts, as well as switching to ATtiny85 (45 and 25 probably work just as well) and using internal oscillator instead of external crystal!
Update2: Due to some requests, I've continued the tutorial with treatment of HID keyboards, too: