Many DOS games were written in C or C++ using Watcom C++ compiler. Those typically display "DOS/4GW Protected Mode Run-time" on startup.
There's Open Watcom project at http://openwatcom.org (latest release from 2010) and a "V2" fork at https://sourceforge.net/projects/openwatcom/f … /current-build/ (2015, new features but rather beta quality)
There's also DJGPP http://delorie.com/djgpp which is a DOS port of well-known GCC compiler. It's quite current (GCC 5.3.0) supports modern standards (C++11, C++14) and is actively maintained.
An old version of DJGPP was used in Quake. I successfully compiled Quake from source (after minor fixes) using the newest version.
You can also write in Free Pascal http://freepascal.org whose DOS version is DJGPP-compatible (it's possible to mix C and Pascal code in one EXE).
Those are all 32-bit compilers that generate executables which should run in DOSBox and on real DOS machines.
I wouldn't really recommend using old, old 16-bit compilers like Turbo C++ or Turbo Pascal, unless you are curious how coding looked like in 1992 😀
Obviously you'll need some libraries, especially for sound and graphics. Google for it, I can't help you much. Or find the specs and write your own routines..
One library I can give you a link to is Allegro http://liballeg.org They dropped DOS support years ago, but you can still find old versions on their site.
I remember that it worked both in Watcom and DJGPP.
I recommend 32-bit version of Windows for this task (even Windows 10 is OK, but 32-bit) so you can actually run DOS tools natively (the compilers, not necessarily the game itself). Otherwise on a 64-bit system you'd need to use a cross-compiler that runs on Windows but generates DOS executables, which can give you headaches.
Forget about running the compiler inside DOSBox. It's painfully slow and may not work.