by 1828, representing the colloquial contraction of give me. To have the gimmes "be eagerly greedy" is from 1918; gimme cap attested by 1978. Middle English had yemme, gemme, contractions of yeve me (Middle English form of give me).
TOMMY — Gimme a cake.
MAMMA — If what? — If you please .
TOMMY — O, let up on that Pinafore business; gimme a cake!
["Puck," July 2, 1878]