First, you need a MIDI loopback driver such as LoopMIDI or LoopBe. I use LoopMIDI and will refer to the driver by this name.
Create two instrument tracks. Let's call them "A" and "B".
On Track A, put the instrument that is going to output the MIDI you want to record. For learning/testing purposes, I suggest starting with something really simple like Insert Piz Here midiChords, because the relationship between input and output is really easy to understand (and because it's free). If you are recording the output of a VSTi with an internal arpeggiator, see the first footnote below.
Here's the step that I suspect people miss at first. In the dialog box where you selected (for example) midiChords, notice the drop down menu labeled "Select Synth" immediately underneath the name "midiChords". You have to scroll all the way down to the bottom of this menu to find the list of external MIDI devices. From that list, chose "LoopMIDI Port" (or whatever your driver is called). Make sure that "loopMIDI Port" comes after "midiChords" in the lilst of instruments.
If you are playing your Track A arp or instrument from a keyboard or drum pads rather than using MIDI data you have already recorded, then select that device as the input to the track, and arm the track for recording from it. Otherwise, this instrument will process whatever MIDI is already recorded on Track A.
Arm Track B to record and set its input device to the same loopMIDI port that you sent to from Track A. Put whatever instrument the recorded MIDI is intended for on Track B.
If you have an instrument that produces audio on Track A, as opposed to a chord generator or arpeggiator, you will probably want to mute either A or B. If you want to mute Track A, turn the level all the way down instead of using the Mute button. It looks to me like the Mute button defeats the input to the track as well as the audio output.
Hit Record. When you're done recording, Track A will contain the MIDI input from your keyboard or drum pads and Track B will contain the MIDI output from your arp or chord generator.
Hope this helps. If it proves necessary, I'll try to grab screen shots.
Different VSTi's have different options (or no options at all) for controlling what MIDI they send. Using Kontakt as an example, find the Options dialog (a gear icon at the top of the interface). On the "Engine" tab, set "Send MIDI to outside world" to "script generated notes" and/or "script generated CCs". I think that most of the time you will want to capture both, but will not want to echo the input.
Be prepared for the possibility that the output doesn't turn out to be what you expected.
Cableguys MidiShaper is an example of a MIDI source that describes itself to the DAW as an effect rather than an instrument. In Mixcraft, it requires a different approach. See this post:viewtopic.php?f=4&t=22357&start=15#p110264