I'm assuming you're using the serial debugging interface of Windows?
I'm not sure if you can virtually connect a host to a guest via a (virtual) serial line. It works in case you have a common bridged network adapter exposed to the guest. In that case you can debug via a telnet console. This requires your DOS 6.22 to have installed a network stack (which I have in my DOS VMs, but is a pretty involved effort).
In case you're still trying things out, I'd suggest trying FreeDOS in a VM, which is a modern, yet ABI compatible DOS variant. It comes with networking out of the box.
When it's just for debugging the host, it might be a good idea to look at a slightly more sophisticated OS to use as guest. That being said, it might be a better idea yet, to do the development and debugging inside a VM and use the host for debugging. This is especially helpful, when you're doing system related stuff, that makes the OS you're testing on unstable. After all, it's easier to reboot a VM than the host.