You need a combination of Hardware and Software. The hardware is a cable between the diagnostic connector and the device that runs the software for reading codes and/or data. It doesn't matter whether you use a PC-program or a dedicated scanner.
OBDII provides ways for reading/clearing codes and reading all kinds of data - live data, test results and ecu information.
The way it works is the scanner will ask a question and the OBDII legislated ecu's (engine and automatic gearbox) will answer.
Have a look here: http://www.mp3car.com/engine-managem...is-obd-ii.html
and here: http://en.wikipedia.org/wiki/OBD-II_PIDs