I first read about it in Arthur C. Clarke’s book 2001 A Space Odyssey, with Discovery stealing a bit from Jupiter to speed up.
Not fiction, but an early depiction:
This is going to sound wacky, but the first time I ever hard of the ‘Jupiter flyby,’ it was demonstrated by (IIRC), the Muppets! I suspect it was some program that was showing the planned path of the Voyagers, but maybe not. But I know it was in the 1970s.
There’s a bit of a definitional problem here, in that there are many different maneuvers a spacecraft might make which involve gravity wells of larger objects, and some of those may or may not be properly referred to as a “gravitational slingshot”. For the sake of definiteness, here’s how I would define a gravitational slingshot:
A spacecraft is in orbit around a primary. It makes a close flyby of another, much larger, object also in orbit around that primary, during which it burns a negligible amount of propellant. As a result of the gravity experienced from the larger object, the spacecraft’s orbit around the primary is significantly altered, usually in such a way as to increase the spacecraft’s orbital energy.
By this definition, an Oberth maneuver is not a gravitational slingshot, because the change in orbit is due to a significant burn from the spacecraft’s thrusters (a burn which is more effective than normal, but without the burn, nothing happens). The “right turn in space” from Protector is also not a gravitational slingshot, because there’s no primary that the ship and neutron star are orbiting, nor any relevant reference frame in which the ship’s energy is increased (of course there are reference frames in which it increases, but not relevant ones).
Looking up the book, Arthur C. Clarke doesn’t use the term “gravitational slingshot”:
… Like a ball on a cosmic pool table, Discovery had bounced off the moving gravitational field of Jupiter, and had gained momentum from the impact. Without using any fuel, she had increased her speed by several thousand miles an hour.
Yet there was no violation of the laws of mechanics; Nature always balances her books, and Jupiter had lost exactly as much momentum as Discovery had gained. The planet had been slowed down - but as its mass was a sextillion times greater than the ship’s, the change in its orbit was far too small to be detectable. The time had not yet come when Man could leave his mark upon the Solar System.
(My bolding.) I’m guessing he wanted to be more scientifically accurate.
He might not use the literal word, but that’s definitely a gravitational slingshot maneuver he’s describing there, even by my restrictive definition.
A.E. van Vogt uses some variation on this, I believe, in his novel Quest for the Future which was based on his short story Far Centaurus.