I have a setup for developing MSDOS programs from Windows 10 (or whatever Windows you want basically), using the Code::Blocks IDE, and the Open Watcom v2 or Digital Mars C/C++ compilers. Code::Blocks has support for these compilers built into it, but the settings will need a bit of tweaking to get it to build correctly for DOS.
OpenWatcomv2
Open Watcom is the easiest to setup with Code::Blocks. Basically, install Open Watcom following the installation instructions on it's site. Then open Code::Blocks and open "settings"->"compiler" select the "Open Watcom (W32) Compiler", go to "toolchain executables" and direct it to the correct executables and directories of Open Watcom.
C/C++ compiler: wcl.exe
Dynamic libs: wlink.exe
Static libs: wlib.exe
Resource compiler: wrc.exe
Make program: wmake.exe
In the "additional paths", make sure you put
"[OpenWatcomDir]/binnt"
"[OpenWatcomDir]/binnt64"
...assuming you want to use the 64 bit version, see installation instructions otherwise
Also, you will need to go to the "Compiler Options" tab, and right click->modify the option "compile and link for DOS" under the "Executable type options section". You need to add "system dos" in the "linker flags" box, then hit "OK."
I believe this is all you need to do in order to start building DOS programs. Just setup a project with the desired compiler options (memory model and such) and you are good to go. You will need an emulator of some kind to test them without booting DOS or something. I recommend 86Box for testing, as it is a very accurate emulator.