I use the uFirmata library for the arduino which is a light weight firmata library and rolled my own firmarta unit for Lazarus
Explore the links below to see how it works, Apologies for the lack of documentation, but if you have any questions let me know. It was only recently moved over from google code and none of the wiki is online.
Only downside with firmarta protocol is it's not human readable, i.e. it's in binary so is more efficient, but harder to debug.
Lazarus Side:
https://github.com/madeinoz67/rallylog.remote If you;'re wondering why there are no com port config/connect/disconnect in the gui, I made things easier for the end user by using some of the FTDI DLL functions and rolled my own FTDI wrapper to automatically detect and connect to the com port once a device is plugged in (windows only)
Arduino side:
https://github.com/madeinoz67/rallylog.firmware In particular look at the Rallylog directory for the final implementation of the firmware.