Christine Ammer, The Facts on File Dictionary of Clichés, second edition (2006) has this brief entry for smoking gun:
smoking gun Definite evidence of illegal or criminal activity. The term alludes to smoke emitted by a revolver or other kind of gun that has been fired, but it is also used more broadly for other kinds o malfeasance. For example, Time (Sept. 19, 1977) had it, "In fact there may be no 'smoking gun'—no incontrovertible black-and-white evidence of wrongdoing by [Bert] Lance." The New York Times (Oct. 4, 2004) quoted National Security Adviser Condoleeza Rice, talking on CNN about aluminum tubes in Iraq suspected to be used for nuclear weapons, "We don't want the smoking gun to be a mushroom cloud."
The use of "smoking gun" as a literal description of a gun with smoke rising from its muzzle goes back to at least 1843. From Alexander Marlinsky, Ammalát Bek, serialized in Blackwood's Edinburgh Magazine (June 1843):
"What mark can be better than the breast of a foe?" answered Ammalát Bek, riding up, and at ten paces' distance pulling the trigger! .... the gun went off: and slowly, without a groan the colonel sank out of his saddle. His affrighted horse, with expanded nostrils and streaming mane, smelt at his rider, in whose hands the reins that had so lately guided him began to stiffen : and the steed of Ammalát stopped abruptly before the corpse, setting his legs straight before him. Ammalát leaped from his horse, and, resting his arms on his yet smoking gun, looked for several moments steadfastly in the face of the murdered man; as if endeavouring to prove to himself that he feared not that fixed gaze, those fast-dimming eyes—that fast-freezing blood.
The first Google Books match for "smoking gun" in a figurative sense comes from this rather amusing anecdote told (by an unidentified speaker) in American College Health Association, Proceedings of the Annual Meeting (1966) [combined snippets]:
We must prepare in advance our course of action and try to avoid what can be called a "smoking gun decision." The story that describes this type of decision involves a court trial of a man who claimed permanent injury following an accident in which he was struck by a car while riding his horse. In the course of the trial a state highway patrolman described the accident in which a speeding car ran full into the plaintiff on his horse as he rode across a rural highway. The patrolman stated that when he asked the plaintiff if he had received any injuries, the latter had replied, "Of course not! I'm feeling fine." The judge interrupted the proceedings and asked the plaintiff to explain this obvious disparity between history and current complaint. The plaintiff told the judge that as he sat on the highway near his severely injured horse the highway patrolman came up and, going over to the horse, shot him between the eyes. The officer then approached the plaintiff as he sat on the highway and, waving his smoking gun at him, said "And how do you feel?" He said, "Judge, under the circumstances I felt very well." Let's avoid "smoking gun decisions" in the next few years by adequate preparation and organization, recognizing the strength of our well established convictions, standards and principles.
As used by the speaker, a "smoking gun decision" is simply a decision made under extreme duress, as if while a smoking gun were being waved at you by the person asking you for your decision.
The first instance that Google Books finds of "smoking gun" in the sense of "irrefutable proof of guilt" appears in the context of the Watergate scandal of 1973–1974. The phrase "a smoking gun" or "the smoking gun" appears at least six times in Facts on File, Editorials on File, volume 5, part 2 (for the year 1974). And the earliest of these appears in an editorial from the [Cleveland, Ohio] Plain Dealer, (July 11, 1974):
At a minimum, they [transcripts of White House conversations] demonstrate an impeachable failure to uphold sworn constitutional duties. The White House naturally challenges this interpretation and complains about the manner of release, but, significantly, it does not challenge the fundamental accuracy of committee transcripts.
True, the evidence so far does not show the president with a "smoking gun in his hand"—the phrase used these days by congressmen who would prefer an ironclad case before doing anything. However, to pursue the analogy, it is undeniable that a large number of dead bodies keep showing up at Nixon's feet. The cumulative result is highly incriminating—and no amount of dodging and diversion by White House lawyers and apologists can obscure that cold fact.
I wouldn't be at all surprised to learn that lawyers in the United States (and elsewhere) have been using "smoking gun" in the figurative sense of "decisive proof" since long before Watergate. But the Google Books database yields no smoking-gun evidence of any such usage from before 1974.