A quick Google search, during my lunch break at work, informs me that carrot cake has its origins in Medieval times. Perhaps this makes it the first vegetable to be used in sweet cookery, though I have no other basis for making this claim. Now you can find recipes for allsorts of desserts using vegetables: beetroot brownies; courgetter lemon sorbet... I forget what else. Oh, rhubarb (maybe that predates carrots).