If there is a tangible object being passed from one person to another, then we can say it either way:
On the first day of Christmas my true love gave to me a partridge in
a pear tree.
On the first day of Christmas my true love gave a partridge in
a pear tree to me.
On the first day of Christmas my true love gave me a partridge in a
But if what is being given is intangible then we tend not to use to.
She gave me her approval.
I do not like that model car. I would not give it a second look.
Give me some time. I need more time!
She gave me quite a surprise, showing up unannounced like that.
The frayed wire gave him a shock.
Your essay is very good. I will give it a B+.
The risk of running out of gas in the middle of the desert gave me pause.