This topic is too diverse to be covered in the first version of this document. Please see:
The O'reilly book entitled "Linux Device Drivers" (2nd Ed.) for a comprehensive guide. You can read it online, but buying a hard copy of the book is encouraged.
The Module Programming Guide as a more concentrated source of information. Now maintained by Peter J. Salzman.