Specifically for sending commands and receiving sensor data.
Using what interface? it's not like you plug sensor directly into your mainboard. You will use RS232, USB, or some other interface to communicate to external AD converter, to which in turn a sensor is connected.
This means you need to find out two things:
How to use the interface you'll be using (for example: opening/closing RS port, sending/receiving data over this port)
What commands you need to send to external hardware, and in what format you will receive data.
Depending on your hardware and setup you might want to look at the player/stage project. This provides a hardware abstraction layer for many robot platforms and sensors and has both C and C++ clients. It can run distributed across multiple machines so you can do stuff both on the robot netbook and your desktop. This package is used by a large number of robotics researchers and provides support for many common robotics tasks. If it's appropriate it will save you a lot of work and wheel reinvention.