I use a Yamaha YPG-235 keyboard, and it works great for synth parts in Sonar. All I ever did is install the midi drivers for the keyboard, connect to the computer via USB, and tell Sonar to use it for a midi input device. (I don't use it for its on-board sounds, so I don't have it selected as a midi output device in Sonar).
To @loptec - you were quite correct, it is SUPER simple - except you don't actually have to match midi channels. Sonar uses a default setting of 'None' which corresponds to midi 'Omni', meaning that by default the midi track will respond to any incoming midi messages.
If one chooses to change the midi OUTPUT channel, to perhaps create drum track events for midi channel 10, then simply go to the console channel strip for the midi track and just under the FX Bin you will see a place to change the midi Output Channel. That's all you have to do, assuming your drum synth either is also set to Omni or is also set to midi channel 10.
Bob Bone