When you leave Switzerland permanently, you will need to obtain written confirmation from the Gemeinde that you're leaving and on which date. A copy of this will be required by your pension fund, your payroll dept, and just about every large vendor you deal with when closing your account (eg UPC Cablecom even asked me for it so I could close off my account)
(1) Visit your Gemeinde (Einwohneramt) no more than 4 weeks before your leaving date. They won't speak with you before then.
(2) They will require your Work Permit and ask you to surrender this, so be careful if you need to travel overseas with in the 4 week period. You can obtain a written confirmation letter from them if you need one for CHF20.
(3) Please take along your paperwork for any pension scheme you have if you intend to withdraw some of these funds in cash when you leave. The Steueramt will need to confirm this and have you complete a form (in German)
(4) You will also be given a tax declaration to complete for the current incomplete year.