My story is similar. I loved computers and programming, have a degree, done it for years, in my early 30s. I spent 80-100 hour weeks keeping a dying startup alive for a year without pay before finally leaving. My mental state was very similar to what you describe: Loss of interest, decreased self-worth, and an uncertain future. It sucks and I'm sorry you are going through it.
I wish I could tell you how to move past it, but I haven't figured that out yet. I also suspect different things work for different people.
I agree with the others who suggested this may be burnout and/or depression. It was in my case, although I am predisposed due to personal and family history. Consider therapy, meds, exercise, socializing, and self-help books. I recommend the CBT-family of therapies (CBT/DBT/ACT/REBT) and books by Albert Ellis and David Burns in particular. Therapy and self-help can be beneficial regardless of whether or not you have a mental illness.
I would not recommend what I did: I moved to a new city to take Masters-level CS courses as a non-matriculated student, with plans to apply to grad programs if it worked out. It didn't. I failed miserably. If you don't have an interest in the professional work, it may transfer to academic work and further complicate a difficult transition. The lack of social support and career network also shouldn't be underestimated. Although switching gears and pursuing education may be exactly what you need, be aware of the risks.
Make a goal of building the life you want. Don't fret over sunk costs. It's not too late to start over or change direction, and your skills and experiences are likely to be valuable even in completely unrelated pursuits. Best of luck!