You should be able to use your Yamaha as an external synth to get its sounds, but you won't be able to drive its accompaniment system. You will need a patch map to access the sounds properly (someone will probably have already prepared one, or you can even convert an exiting one from Sonar to use).
I use my Casio arranger keyboard as an external synth to get to all of its sounds and it works fine, so it should be similar to your Yamaha. I also use a Ketron SD-2 sound module (which has no keyboard, but for sounds, the concept is the same). The question, of course, is whether your keyboard connects via MIDI cables or USB cables. If USB, you can plug directly into your computer, and you should be able to select it as your MIDI output device. If MIDI cables, then you'll need a MIDI to USB adapter to connect it to your computer, and then you would select that adapter as the MIDI output device. I use an
EMu XMIDI 2x2 for my keyboard(s) and it works great.
If you want to record those sounds, however, you'll have to reroute the audio sound from your keyboard back into your computer's sound card.
What I do is to send the keyboard audio to my mixer, which feeds into my M-Audio Fast Track Pro, which is connected to my computer.
Below is a picture of my routing configuration, which works well for me. I don't have a lot of high end equipment, but I have a lot of fun with what I do have. Both keyboards are able to create MIDI-In, be used as MIDI-Out, and with the mixer in the mix (so to speak), I can record guitar and vocals, as well.