-ing form after to

We sometimes use an ing form after to.

    I look forward to seeing you. (NOT . . . to see you.)
    I’m not used to getting up early.

These structures may seem strange.
In fact, to is two words:
a. a part of the infinitive

    I want to go home.
    Help me to understand

b. a preposition

    I look forward to your next letter.
    I prefer meat to fish.
    I’m not used to London traffic.

After the preposition to, we can use an -ing form, but not usually an infinitive.

    I look forward to hearing from you.
    (NOT . . . to hear from you.)
    I prefer riding to walking.
    I’m not used to driving in London.

If you want to know whether to is a preposition, try putting a noun after it. Compare:
a. I want to your letter. (Not possible: to is not a preposition. Use the infinitive after I want.)
b. I’m looking forward to your letter. (This is all right, so to is a preposition. Use the -ing form after look forward to.)