Brandon Sanderson's
Mistborn begins many years after the heroes have failed, and the world is ruled by an immortal villain. His comic,
Dark One (recently on sale) also has an evil ruler as its protagonist. There are many stories from the villiain's point of view.
As for stories where the good guys fail at the end (rather than in the middle of a series, which is common), I can't think of any. I have some examples of a Pyrrhic victory where the protagonists are left broken AFTER defeating the big bad. This
reddit thread on the same question brings up grimdark series.