You can get driver source code examples direct from microsoft.
Kernel-Mode Driver Framework
Version 1.1
Updated: May 11, 2006
KMDF implements the fundamental features required for kernel-mode drivers, including:
• Plug and Play and power management
• I/O queues
• Direct memory access (DMA)
• Windows management instrumentation (WMI)
• Synchronization
KMDF includes:
• Header files
• Libraries
• A redistributable co-installer
• Sample code
• Development tools
• Documentation
**broken link removed**
Enjoy