Through Windows, you go to "Sounds and Audio Devices" from control panel. Then choose the "audio" tab and you'll see a list of playback and recording options. Under "MIDI music playback" you can choose your MIDI port that's on your soundcard. For example, with my SBLive, I have the option of choosing "SB Live! MIDI UART". Choosing this option sends all MIDI info through the MIDI port, allowing an external synthesizer to play the tracks. In this case, DOSbox will send the MIDI commands to Windows, Windows sends the MIDI commands through the MIDI port on the SBLive and the MT-32 attached to the SBLive plays the songs.
The only problem so far with DOSBox is it sends MIDI information too fast and causes MT-32's to get "Exc. Buffer Overrun" errors. This only occurs when a game uses a custom sound patch for, obviously, custom intruments and settings. Since a lot of games use this customization feature, a lot of games don't play sound correctly. The only remedy for this right now is to play the games on an actual older machine that isn't too fast for the MT-32.
If only there was a way that DOSBox could slow down how fast it sends the MIDI patches over the MIDI port...