If you create an installer for your app using a visual studio installer project, you get the uninstaller with it. This works the same way with the NullSoft installer and WiX. The way this works is the MSI file (installer file) is not an executable, but rather a database file packaged with your application files, and it tells windows where to put the files. When Windows installs your app, it logs what it does, and so when it uninstalls, it undoes what is in the log. It's actually a lot more complicated than that, but basically that's how it works.
NullSoft and WiX are way better than the basic visual studio installer project, which is difficult and very cryptic, so try to use one of those if you can.