It would work a lot better if you had an audio interface - routing-wise and latency-wise.
The way it is done, is you create a loop where the MIDI signal is sent from your controller or out of your DAW to the hardware that you would like to record the audio from, and that audio signal is then recorded into your DAW.
Hope this answers your question.