@Peter has already posted library links.
I recommend that you use node.jsNode.js (node-serialport) or pythonPython (serial), which have excellent native serial support.
Both of these use C++ internally to communicate over Serial (Serial.h). Try going through the code Node.js uses internally, and if you are willing to write that much, by all means use the library.