For floors that only have small dips in them you can use a self-leveling filler. This works for any type of subfloor that is going to have a finished product on top of it. Carpet, tile and hardwood all benefit from this type of leveling. Self-leveling filler is lightweight and meant to be used for patch areas. If you have large areas that need to be fixed there are other preparatory steps that will need to be followed.
With areas that have a fairly severe drop-off, such as with an older floor that has begun to sag in one area, you can bridge that gap with a sheet of underlayment, such as that used for tile installations. The floor still needs to be shored up to provide adequate support, but once the supports are in place you can install a sheet of cement or fiberboard in the lowest part of the tip, then span the remaining gap between the original subfloor and the sunken section with some of the self-leveling compound.
If the floor is out of level across the entire length you can try the tapered shim method. This works best before the subfloor material is actually installed. You need to use a string line to determine exactly how out of level the joists are, then trim down a length of the joist material at the angle required to create a level base for the subfloor. These tapered shims are screwed and glued on top of the joists, and then the subfloor is installed on top to create the level surface for the rest of the house.
When working with an older home that has more than 60 years behind it and things look like they on the verge of collapsing -- and you still think you can salvage things -- talk with a structural engineer about the ways you can level the upstairs floors. Sometimes this will involve jacking up the floor beneath, shoring up the outer wall and adding new supports, but you should always contact a professional before attempting major repairs.