Create a new session and call it "Instrument Track Test."
Now create a stereo Instrument Track.
Set the output to Analog 1-2.
Insert a virtual instrument onto the "insert" of the track within the Mix window and select a patch.
In order to properly route the I/O for the instrument you'll need to be able to view that portion on the track.
To do this, select "View" from the File Menu and choose Mix Window>Instruments. You will now see the options at the top of the track.
The default location for Instrument controllers is set to "All." This will usually work for most USB or MIDI controllers. This tells the computer to acknowledge all controllers in use. This would change to a specific controller if you plan to use multiple controllers in your session.
Record enable the track by depressing the red "R" button on the track and bring up the fader level. You should now be able to hear the sound of the instrument being played back by pressing any key on the keyboard controller.
Press record and play a few notes. You will see the data being recorded in the Edit window.
The MIDI information can now be edited any way you wish.
It's never been easier!