The Michael R Sweet reference looks really good - I'll keep this handy. But, it shows only the C interface. The samples demonstrate the critical components, and understanding it is a necessary first step before building your object oriented design.
If your target supports standard exception handling, you can take advantage of C++ streams. Here is an example
http://www.webkruncher.com/speedstreams.h that demonstrates using C++ iostreams for a local file. I've used the same method to interface with serial ports and sockets. It can be adapted to virtually any IO. Even if your IO needs to be fully optimized, you can still take advantage of the OO structure.
The goal is really to have one, straight forward C++ header file that defines and fully implements everything needed to communicate with your target port. Then, your protocol manager sees your target device as if it were a simple file. So, when you initialize the system that interfaces with your target device, the source code could look something like this....
SerialStream io("COM1");
while(!io.eof())
{
string line;
getline(io,line);
}
io<<"hello"<<endl;
Then you build an object to manage the negotiations required by your protocol and put it to use.
Hope that helps.
-Jmt