File your claim for unemployment. Move forward and find another job. Any age discrimination complaint you might want to pursue is going to take a long time and have a very limited potential for success. Unemployment is immediate and is designed to tide you over until you find another job if you are out of work through no fault of your own.
From the sound of it, you have been let go under this sort of circumstances. "Laid off" for performance issues means they just wanted to get rid of you, but perhaps aren't going to officially terminate you, so you'd likely qualify for unemployment benefits without a struggle. That you had just turned 40 happens to be a coincidence, or maybe not, which correlated with the fact that they wanted you gone. And once you are no longer working at a place, your performance evaluations at that place don't matter at all. They very rarely have to give anyone a severance if they don't want to. Sounds like they found a way to deny yours. One thing I've noticed, that in the highly technical, very specialized fields and jobs, many times they'll get rid of a long term employee to replace with not just a cheaper employee, but an employee with fresher technical skills. This doesn't necessarily mean younger.
If there is not a pattern of such behavior, if they have other employees that they did not lay off/downsize/ find redundant/ let go when they became older, that's really going to reduce your chances of showing any kind of age related bias. In most cases, "they can't do this to me, can they?" can pretty much be answered by, "Yes, they can" because really, though most people don't realize it until it happens to them, there's usually no labor law that says they cannot, unless you are covered by a union agreement giving you this specific protection.