Comes from the notion that it "takes money to make money". "Cheese" and "Cake" are both slang terms for money. Therefore, when you put them together, you have "CheeseCake" or, money that you will be using with the primary objective of making more money.
Person 1: "I want to become a pro golfer"
Person 2: "Ha, let me tell you, considering the amount of money thats required for you to spend in order to become a very good golfer (Clubs, Tee Times, Lessons), your gonna need that CheeseCake. Pro golfers make alot of money, but your going to have to spend alot first."
Person A: "Dude I want to start my own business."
Person B: "Yea, but you gotta make that CheeseCake first."
"Yo man, I'm workin this 9-5 so I can get that "CheeseCake" to go gambling with"