I had the same issue.
>> ib = ibtws('',7496); Error using actxserver (line 90) Server creation failed. Invalid ProgID 'TWS.TwsCtrl.1'. Error in ibtws (line 38)
After I installed all the required software the issue persisted, then I realized that after setting up TWS, it is necessary to perform a TWS register procedure to activate the communication between MATALB and TWS. After TWS is installed, go to C:\TWS API\bin\ActiveX folder to find file Tws.ocx, right click and select open with other software, point it to MATLAB, then it will be working.
You can find more specific details in https://www.interactivebrokers.com/en/index.php?f=5041, search for Getting Started with the TWS ActiveX API, download it. At the end of the guide, you can find more details about establishing communication between TWS and other software.