Many of the greatest wizards in the Harry Potter universe invented their own spells.
Dumbledore, acknowledged as one of the greatest wizards of the age:
"Examined him myself in Transfiguration and Charms when he did NEWTs ... Did things with a wand I'd never seen before..."
-- Griselda Marchbanks, HP and the Order of the Phoenix, chapter 31: OWLs.
Snape, perhaps not one of the greatest but certainly a very talented student while at Hogwarts, and a master of the rare art of Occlumency in later life, invented numerous spells including Levicorpus, Liberacorpus, and Sectumsempra.
What about Harry Potter? After defeating the Dark Lord, he's surely seen as one of the greatest Aurors of his time, and he always topped his Defence Against the Dark Arts class (I think?)
Did he ever invent any of his own spells?
(I'd also be interested in Hermione, who's perhaps a more accomplished witch in everything other than Defence Against the Dark Arts, or indeed anyone in Harry's generation - students at Hogwarts during his time there - since I can't recall any mention of spells invented by any such people.)