Firmata a generic protocol for communicating with microcontrollers like the Arduino from software on a host computer.
For the Arduino Library, it is included in Arduino since version 0012, so see the library reference page. For more on the Firmata protocol, see the protocol documentation.