It's not that complicated in theory: it just a case of pairing up groups and passing the result through to the next stage. It's drawing it that's difficult bit.
Start with getting the data structures right: I'd probably have a "match" class or control which took two inputs, and had a result and get it to draw itself:
Name1 --
---
Name2 --
Then have a list of Matches for each stage of the competition.
Or...you could have a look at this:
http://www.tourneylogic.com/[
^]
It's for website, but it might give you some ideas.