The legality of the cake sales to your city/state/local health department is whole separate issue here. As someone else noted earlier, income from illegal activities must be reported as income like anything else. (That's what's finally got Al Capone...tax fraud on his illegal activities...but I digress...)
It's pretty simple once you wrap your mind around how the IRS does things: If you sell a cake (regardless of whether you profit on that cake or your caking activity in general), you need to either report it as a hobby or a business. Period.
If you have repeated losses for multiple tax years, you need to report as a hobby. The IRS looks at like this: If a cake baker decorates cake and loses money for, say, 5 years straight, why the heck is he/she still running this "business"? A "rationale person" would get out of that "business" and cut his/her losses. If he/she stays in the "business" while continuing to lose money, it is a hobby and reportable as such. Obviously, there is an element of personal pleasure that keeps the decorator decorating cakes that fail to result in a profit.
Side Note: I remember reading about a court case that revolved around an "aspiring professional golfer" who wrote off his weekly rounds/golf clubs/travel expenses, but he never netted much as far as prize money. He was realistically never going to make it in the PGA, so his activity was a hobby as ruled by the court.
Again, repeated losses are the key factor here if you are looking at it in hindsight-regardless of who you are selling to...In other words, if you are selling to complete strangers but still have repeated losses, you are a hobby.
To be more specific on "repeated losses," the IRS has a guideline about number of years and losses.
"An activity is presumed for profit if it makes a profit in at least three of the last five tax years, including the current year (or at least two of the last seven years for activities that consist primarily of breeding, showing, training or racing horses)." http://www.irs.gov/uac/Is-Your-Hobby-a-For-Profit-Endeavor%3F
Try not to think about it in the "common sense" way...unfortunately, our tax code was not written in the most logical of ways...Again, it's important to do your research and then talk to a CPA...Hold your CPA accountable because you are responsible for your tax return in the end.