Switzerland is totally landlocked - it needed to maintain good relations with Germany to continue to trade. It got most of its coal from Germany, for example.
It suited Germany to have Switzerland as an independent country - it made trade easier between the Nazis and other countries.
Swiss factories made arms, weapons component, aluminium and equipment for the Nazis and bought gold from Germany, giving the Nazis much needed hard currency.
There is a bit of information here:
http://switzerland.isyours.com/e/swiss-busines s-guide/wwii.html
http://en.wikipedia.org/wiki/Switzerland_durin g_World_War_II
Switzerland has some very strange polices overall, I find. Women didn't have the full vote until 1990, for example.