The first phrase (with "to hear") is the incorrect phrase.
The second phrase is correct because "to" is a proper preposition and not part of an infinitive verb. This means a gerund ("hearing") must follow. The simple way of checking is this: can you replace the verb form with a regular noun? Then you need a gerund. :)
I am looking forward to your reply.
I am looking forward to an answer.
I am looking forward to hearing from you.