Courtesy of the Good Math, Bad Math blog, check out the following video entitled: How to Write a Fugue. Oh, did I mention that it demonstrates by using a theme from Britney Spears?
Warning: inexplicable blackboard cartoon of phallus may offend… well.. someone.