The exclamation Cowabunga! comes from the children's television show The Howdy Doody Show, which ran from 1947 to 1960. Chief Thunderthud used it as an exclamation in response to bad things; good things were greeted with a rowdy Kawagoopa!.

Originally it was usually written with a 'k', either as 'kawabonga' or 'kowa-bunga'. And for those of you who really do care about these things, it was written that way (and presumably also invented) by Eddie Kean, long-time and super-prolific scriptwriter for the show.

Eventually the kids who had spent hours in front of the TV watching Howdy Doody grew up became older, started surfing, and started using it as a cool thing to yell when cresting a wave. This was helped along by another TV show, Gidget (1965-66), in which the surfers used it regularly. This may be when the current spelling first appeared.

In the 1970s (and on into the 80s, at least) it appeared regularly on Sesame Street, where Cookie Monster would yell it when eating something exciting (usually a large pile of cookies). Sesame Street apparently used the 'k' spelling; Cookie Monster used it in a Letter of the Day sketch as his example of a 'k' word. (When Prairie Dawn claimed that 'kowabunga' was not a word, he told her: "Kowabunga too a word. It esoteric, but it poetic in its own right.")*

In the late 80s and early 90s it was kept alive and cool when it was used by Michaelangelo in Teenage Mutant Ninja Turtles and then by Bart in the The Simpsons.

60 years, and cowabunga still isn't uncool. Not quite as long a run as cool and OK, but quite respectable for a made-up nonsense word. These days cowabunga has taken over the role of the original Kawagoopa, and is a positive exclamation or battle cry, indicative of unbound exuberance or a devil-may-care attitude.


References:
The Oxford Dictionary of Catchphrases, compiled by Anna Farkas
* http://en.wikipedia.org/wiki/Cowabunga
Sesame Street quotes are from http://video.aol.com/video-detail/cookies-letter-of-day-k/3929098541