first of all, you must have 2 cables that'll connect your computer and your Yamaha in cross mode:
Yamaha MIDI IN <-> Computer MIDI OUT (make computer command the yamaha)
Yamaha MIDI OUT <-> Computer MIDI IN (make the yamaha command the computer)
With that, you'll have in your Yamaha to choose a MIDI CHANNEL ( from 1 to 16 and generally 10 is for drumkits)
On your music software, activate the same midi for records
Start records and play on your yamaha.
It may work this way.
One more thing to know.
If your Yamaha own a sequencer, you'll have to choose 1 midi channel per sound channel. Same on your computer so you can record 1 channel and after, record another one with the previous recorded ones playing at the same time.