It's hard to come up with historical examples of something very bad that resulted in something very good. It might even be an impossibility, but let me propose a different look. Instead of expecting something good to be a consequence of something bad, let's look for something bad that could have gone much worse. That is easier find.
Some people genuinely argue that the Hiroshima bomb, while a tragedy, prevented the loss of innumerable more lives (something I don't quite believe myself). The killing of Bin Laden is another bad event (pre-emptive killing of people) considered a good act, because he was a dangerous man who could cause the death of tens of thousands of people. The extermination of animals carrying disease, the use of force to prevent crime, the destruction of private property (in sabotage operations) to disrupt oppressive regimes, the payment of taxes or the act of voting in order to ensure one's own safety or his family's. Don't you think this qualify as "good" coming from evil?
But I think this is a serious question: is it moral to do something immoral in principle, but that's believed to bring a better outcome? If you say no, then you're guilty of acting according to what feels good instead of what does good (you gutless phony). If you say yes, then your position is terribly close to a suicide bomber's who thinks the terrible loss of lives is a small price for obeying the will of his god. Imho, simply prioritizing principles or consequences over the other will lead to failed morality.