Check out this site with a lot of facts on gun ownership in Germany.
http://www.gunpolicy.org/firearms/region/germany
What you see is a pretty high rate of gun ownership - 30.3 guns per 100 citizens, #4 in the world. Nonetheless the rate of gun deaths is only 1.16 per 100,000 population, and the gun homicide rate is 0.2 per 100,000. The US is at 10.2 and 3.7, respectively.
I believe Germany has a long tradition of hunting and marksmanship. Germany is also generally recognized as a pretty healthy democracy with a high level of individual freedom, despite their rather ugly history. Nonetheless, Germany requires all firearms to be registered and owners must have a permit and some level of training (not sure what level). Each gun must have a unique identification mark.
From a very surface view, it looks to me that Germany has struck a pretty good balance between allowing law-abiding citizens to own guns while preventing them from falling into the hands of violent criminals.