Ironically, the only country that Germany formally declared war on was the United States.

Germany's style of war, the blitzkrieg, worked best with surprise on their side. Thus, Germany would not declare war, and lose the element of surprise, but instead just invade. Examples would include Germany's invasion of Poland in 1939; or their invasion of the Soviet Union in 1941. Hitler was quoted saying "[O]ne should strike – as hard as possible – and not waste time declaring war."

The United Kingdom and France declared war on Germany following the invasion of Poland. As a state of war existed, Germany thought it was unnecessary to declare war themselves.

With the United States, Hitler decided to legally and formally declare war. Hitler was convinced that the US had violated the rules of neutrality. When the United States entered the war fighting Japan, a Tripartite Pact member, Germany felt that there was enough provocation to go to war.

More Info: en.wikipedia.org