The ELM327 datasheet from elm electronics has a complete walkthrough to do exactly what you want [the walkthrough starts on page 28, but I strongly suggest starting at the beginning - as far as datasheets go, that one's surprisingly palatable].
A,B,C,D are the four bytes returned by the device as actual values. Note that a lot of OBDII mode 1 PIDs return less than four bytes [so you'd just populate A and B, for example]. Also, some mode 1 PIDs return more [according to the spec], although you're unlikely to actually need that.
Once you've decoded the trouble code, you'll need to look up what it means. You may find this gentleman's work to also be useful.