I've got a trouble with getting my voice into the right key. If I start on the right key I stay on it, but the problem is getting it right on the first try. Usually I start singing in D no matter what the key is.
Any advice?
play songs in D, lol. That is until you figure out how to move your voice out of its comfort zone.

Perhaps a tuner would help you get started on a different note.
play the root note or the tonic chord of the key you want to sing in on the guitar, and then try and match that note with your voice, if you're live, just try humming it maybe, and then you should be able to recognize if you're out, adjust your voice and then sing away (:
Work on your ear so you have a better sense of what the key is from listening.