Etymonline dates the single word "slam" to the 1600s, but not the term "grand slam" (although they're likely connected). The entry for "grand slam":
Grand slam in bridge first recorded 1892; earlier in related card games from 1814; figurative sense of "complete success" is attested from 1920; in baseball sense from 1935.
The OED has all the same years (apart from baseball in 1953: is etymonline's a typo?).
I've antedated three of etymonline's four senses.
Related card games
I found an antedating for at least the "related card games" sense (OEDs: 1814), from The Sporting Magazine, For July 1800 (the 1814 being a revision of this):
This is under "Rules for the Game of Cards called Boston" which it says is a "small Pamphlet, Price 6d, Gravesend, Printed by R. Pocock, and sold by Messrs. Robinsons, London" and:
The Game of Boston according to the Introduction to this little Tract was first invented by the officers of the French army in America during the late war there, and has been since introduced into this country by the officers of the Russian ships of war.
Another antedating I found is in the context of baseball, but rather than a homerun it refers to a complete success (OEDs: 1920). From a report in the newspaper The Garden Island., July 07, 1914:
It was surely one, grand slam
that the All Students baseball
team put over on Kauai last Saturday, and most people have
spent a lot of time since trying to
figure out how it happened.
In baseball a grand slam is a home run. The OED has it from 1953 and etymonline since 1935 (but is that a typo?). Here's Babe Ruth writing in The Evening World, August 20, 1920 (Wall St. - Final Edition - Extra):
In less than two full seasons, 1919 and 1920, my
grand slams mount up to seventy. Do you know that the home run leaders of the American League ran up a total of only seventy-two in eight full seasons from 1908 to 1915, inclusive? Any more brown derbies around?