Can anyone recommend a good book or any documentation that explains/teaches you how to directly access any devices on a computer using C++ programming?
For example, say I wanted to access my network interface card to direct the packets to an i/o stream or "command" my NIC to ping a host on the network.
Or,
Perhaps I wanted to build a script that monitors the com port that my printer is connected to.
If you'd like a taste of direct hardware programming, look into microcontroller programming. The Atmel AVR, Microchip PIC, and Parallax Stamp microcontrollers are all popular hobbyist components.
The Stamp would be the easiest to get into, but it only provides it's own proprietary BASIC programming environment to program it. The PIC and AVR can be programmed via Assembly or C compilers, though the PIC would require you to purchase a C compiler for it (there are no free ones). The AVR has a free C compiler.
Note that, unless you buy a kit of some form, you're going to need some basic electronics knowledge to get a microcontroller up and running. Even with a kit, it'd be useful to have that knowledge as well.