Drivers are very similar to any other program, they can be comprised of multiple source files. Linux devices drivers can be directly compiled into the kernel or a kernel module. Kernel modules have the benefit of being able to be loaded dynamically (i.e. you don't need to compile a new kernel to use them).
You can obviously always look at the Linux source code, but that can be a daunting task at first. However, as with anything in Linux drivers are files. That means other programs access them via the VFS interface. For example, you can control the CDROM via ioctl()
calls using its device file.
I would highly recommend checking out Linux Device Drivers. It's freely available and will answer your questions. In particular, you can read through chapter 2 which shows you how to create a simple "Hello, Kernel" module. It may be far more than you are asking for, but you can read the bits and pieces you are interested in. And its free. ;P