C++ communication with Arduino using SerialClass.h

PaulS:
Send a command to the Arduino. If you get a response, it's still connected. If you don't, it isn't (or it crashed).

Is it possible to operate a specific program with Arduino. Can Arduino run as input device to give command like distance to move and angle of rotation to the software which controls hardware like robotic arm CNC machine etc.