I lucked into a situation with one product where basically a client needed a tool to do a job but it was something we had solved like 6 times in the past couple of years, so we knew there was a market for it. So we did team up with him on it essentially. He had no interest in the product part, just needed his problem solved, but he liked the idea of a discount on his dev fees. So what we did is cut our dev fees to him (still covering our costs), he got a worldwide non-exclusive license to use the product but not to resell, and we kept the rights to resell. So in the end, he got a product & free support for a period of time (at a steep discount) and we got a money maker, not great money but real money.
The second time I just sucked it up and used off-time and down-time from consultants and myself to build the product. While it took us much longer, and nearing launch we had to dedicate more time to it which meant me funding a couple of people full time (versus just down time hours), I would say I preferred this route. It meant we didn't have to compromise on features, or develop a feature we felt/knew had no basis to be in the product. What I liked was we could focus on making a product first, which is hard to do when you are essentially solving someone else's problem. I'd do this route again over the other just for the simplicity, yes more risk, yes longer time to market, but much less of a compromise which you then turn around and spend months fixing later.