The first thing to do is get a structural engineer to tell you what must be done. Since it is older and soil bearing may be a part of it, any prescriptive code requirements and he will have to come up with a solution to satisfy the town. He probably will give you several options. You will need someone to sign off when you do the jbo, so you might as well get the information early.
One you know what has to be done, you get go about getting prices that really mean something. Prices over the internet really mean nothing since little information is given.
Foundations can have a wide range of cost depending on what has to be done. If the soil is not good enough for the extra floor, you may need bigger footings or more footings under the house. If you get into making changes in the footings any footing code changes since 1940 would have to be implemented.