The obly thing that finally helped, even after meds (I think) didn't do much, was a very solid "Fuck this, I don't want this anymore" and willing myself out of it by forcing myself to become a workoholic. It gave me interesting things to do and kept me distracted from the ultimate pointlessnes of it all.
Eventually the pointlessnes became my greatest asset. If nothing matters, then you can do anything right? Why give a shit about how a thing turns out, just try.
My psychiatrist at the time said that the meds gave me space to will myself out of it but who knows. I'm sure it went hand in hand.
On the other hand, it's been 13-ish years and too much leisure time still gets me sliding back towards a pit of despair. I'm probably not cured at all, just coping, and I'm likely to have to continue coping forever. Like a former drug addict or alcoholic.