Even more so than when you work at a company you need to become involved in a professional organization. It will help keep you sharp and relevant. Organizations offer networking and fill the social gap you’ll find as you no longer have coworkers.
I recommend the Freelancers Union.
A local chamber of commerce can also help with the solitude, as well as conferences in your industry.