Donaldson's Thomas Covenant is generally regarded as an anti-hero and isn't a particularly nice character, but he's definitely on the side of Good in the series. Personally, I found the characters in the SF Gap series even worse - I couldn't get past the first book so I couldn't say whether Good triumphs over Evil, or even if the sides are clear-cut.
Not fantasy or SF, but you might try John Fowles' The Collector.
I've heard some things about John Ringo's Ghost, but never read it. It's available at the Baen Free Library.
If you're interested in stories that are more ambiguous regarding good and evil you might like Guy Gavriel Kay's The Lions of Al-Rassan. Neither side is good or evil. The two protagonists are good men on opposite sides.