Welcome to LinuxQuestions.
When inserted a USB device goes through an enumeration process where the computer identifies and loads a driver if recognized. This is all part of the USB subsystem and so writing a program is not required.
Depending on the make/model of USB chip you are using (like FTDI) it might have the USB protocol built which simplifies your design. In addition the computer driver is already written which eliminates driver development in most cases. If the USB chip is recognized as a virtual com port then your application program can use standard serial port protocols to set the speed and baud rate etc.
You can easily find the USB specification on the internet with a quick search but here is link that provides a simplified description.
http://www.ftdichip.com/Support/Docu...numeration.pdf