It depends on the current that is required. There are many solutions.
For just a voltage level, where minimal current will be sunk, connecting one side of the switch to Vcc and the other via a suitable resistor to 0V will do the trick.
If you need more current, then you could either use the same circuit and some transistors to give you a low impedance path to either Vcc or gnd.
Another option is a dip switch that is spdt rather than the more usual spst.
Note that some things listed as DIP switches are not in fact in a DIL package -- if that is important.