The main bulk of my work is original fiction, so obviously that means well-crafted, researched and believable characters. I don't so much as start an outline until I know enough to write on the subject I want to explore.
In the event that I do choose to work with a fandom, my tendency is to create original characters and pair them with canon characters about which somewhat less is known, or who are tertiary to the storyline. An example would be writing a Potter fic in which one of my 'originals' interacts with someone like Blaise Zabini or even Gregory Goyle. I also shy away from insertion into things which the original author has already explored. Gregory Goyle survived past Book 7, for instance; the idea I am knocking around is what he does to redeem himself after all the bodies are hauled away.
The writing of Mary Sues/Gary Stu's is a part of the learning process. Most writers go through a stage where they need to make this mistake in order to learn how not to write. One thing that absolutely pisses me off, though, is the immediate assumption that all original characters are Mary Sues—and I have been in places especially in Potter fandom where that has very much been the case. Between this and what I call the 'Rabid Slashers', I keep most of my Potter fics private. ('Rabid Slashers' are people that ridicule anything that is not a same-sex pairing, and/or that includes any original female character, regardless of whether she is with a favorite of theirs or not.)