This is handled quite elegantly here.
Possession of drugs remains illegal indeed (we are not talking about marijuana here — this is about "hard" drugs). But you can come to one of Quai9 centres and there are drugs available directly from the government (I am not sure whether for free or for nominal price — perhaps the latter), all of Swiss pharmaceutical quality. Heroin is definitely available (the personnel will try to move heroin addicts to replacement therapy ASAP, but at first, they can continue their habit), not sure about cocaine, but I think it is there as well, as there are mentions of "sniffing places" installed, whatever it is.
Thus, there is no possession and no trade (and it's pointless to engage of criminal trade of something that is legally available from the government).
The same goes with guns. It is legal to own, buy and sell very impressive guns in Switzerland, but it is illegal to own _ammo_ (unless you are hunter, or can prove that you need self-defense — but this is how it is handled in most European countries; Switzerland is different by making actual gun trade legal).
So, how do you fire these guns? Simple: you take one of them, go to the shooting range, and there you can buy some ammo to shoot with (it is very illegal to take it home). Shooting ranges are government-supported and regulated (Swiss government actually encourages citizens to train at shooting ranges).