If there is a switch turn it off after each session and turn it on before opening Sonar. If there is no switch unplug it after closing Sonar and plug it back in before opening Sonar.
Also as Bob said be sure to disable USB power management so the keyboard doesn't get disconnected in the middle of a session. Another to remember is that it is best to keep the controller plugged into the USB port it was connected to when you installed the drivers. If you can't remember which port it was uninstall/reinstall the drivers and make a note of which port you used. This supposedly helps to keep the computer from getting confused when it's looking for the device/drivers.
Not all of this may be necessary but it's all little tips I've picked up to ensure things work properly and by following these steps myself I never (touch wood) have had any problems.