Earlier quoted context omitted.
I think it turned out pretty well for NeXT. They are the third largest company in the world by market cap, now.
Their hardware was a resounding flop and building a state-of-the-art production facility for something for which there was no demand is in retrospect clearly a mistake. Also, given that NeXT was bought for about 15% of Apple's market cap (after laying off most of their employees), it's disingenuous to imply that Apple == NeXT. What saved Apple was the iPod, not OS X and Cocoa.
http://www.wired.com/techbiz/media/news/1997/03/2596
edit: I want to add a couple points to my followup.
1. NeXT's hardware was a resounding flop. Their state-of-the-art factory turned out to be for naught. This is absolutely true.
2. That said, this mistake did not prevent NeXT from co-opting Apple and becoming the third largest company (by market cap) in the world.
3. Apple == NeXT: Apple was, pun intended, rotten. Steve Jobs and his most trusted lieutenants assumed key positions of power throughout Apple. The only highly visible and critical Apple employee I can identify who pre-dated Steve's return to Apple is Jony Ive. However, Ive was laboring in obscurity before Steve assumed his position as "iCEO" of Apple[1 and 2].
4. Arguably, the iMac saved Apple. In one of the recently-posted WWDC or Macworld keynotes, Steve addresses this point in quite a bit of detail. The iPod made Apple a veritable powerhouse...but not at first[3]. The iPhone made Apple, well, Apple. As it happens, the iPhone (and OS X, and the iPad) is the result of decades of engineering work that started at NeXT[4].
[1] http://en.wikipedia.org/wiki/Jonathan_Ive#Career
[2] http://www.nytimes.com/library/cyber/week/091797apple.html
[3] http://slashdot.org/story/01/10/23/1816257/Apple-releases-iP...
[4] Or, to be pedantic, at CMU, where Mach was originally co-developed by Avie Tevanian, who later became the SVP of Software Engineering at Apple.