6th Wisconsin has hit it on the nose.
German recognizes 6 cases, nominative (subject case), accusative (direct object), dative (indirect object) and genitive (possessive), plus the vocative (used in declarations or exclamations, but which is really not taught as such anymore).
"Heil" in its sense of "hail!" takes the dative case, and the idiom doesn't require a preposition. "Heil Dir" would be best translated as "Hail to you" (or even better, "Hail to thee"). "Heil Dir im Siegerkranz" ("Hail to Thee, crowned with victory") was an old Imperial anthem (sung to the tune of "God Save the King", by the way).
In English, we don't distinguish as frequently between accusative and dative cases anymore, lumping them together in the "objective" case. Though, a good grammar teacher can still explain the difference to their pupils.
German also has prepositions which take one or the other case exclusively, which makes it easier to learn them, and some that take either case, depending on whether the meaning is of motion or of location. So, bis, durch, fuer, gegen, ohne and um (until/till, through, for, against/toward, without and around/about) all take accusative. Aus, ausser, bei, mit, nach, seit, von and zu (from (a location), except (for), near/next to/at, with, after/towards, since, from, and to/at) all take the dative.
Sorry, I love this stuff, I used to teach it.
Prost!
Brad