It's a shame to have to keep flogging this for the Anons who don't have a grammar book, but:
[
You] -- understood Subject
Give -- Verb
the package -- Direct Object of
give to -- preposition
whoever comes to the door -- clause object of preposition. (
whoever = S;
comes = V;
to the door = prepositional phrase as adverbial of direction)
to whoever comes to the door -- prepositional-phrase equivalent if Indirect Object.
To repeat Komountain, California Jim, Mr Pedantic and Clive:
whoever, whether formal or informal, is correct grammar.
Whomever is hypercorrection.
Everyone is free to use whichever s/he chooses, however.