The Flight Management Computer (FMC) will be loaded by the Pilots with the Aircrafts zero fuel weight, it automatically calculates the gross weight by adding the fuel on board.
With this information loaded the enroute winds (also loaded in the FMC) will also be considered.
On the 757 and 767 that I fly the computer will then give you three altitudes to consider Max, Optimum and Recommended.
The FMC also considers the outside air temperature, if it is warmer than planned, your altitude capability is lower and vice versa.
At the beginning of the flight, as you mentioned, you will be heavy and your optimum altitude will be lower, as you burn off fuel your optimum altitude will increase as you get lighter.
So, ideally you want to try to stay as close to optimum as possible, but !
There are other considerations, for example westbound into the jetstream it may be more economical to stay lower, or sometimes higher than optimum to try to stay out of the worst headwinds, obviously it's no good being at optimum altitude burning the least amount of fuel per hour but then staying in the air an extra hour or more because your groundspeed is so slow and burning more fuel as a result !
Along the same lines it may be advantageous to select an altitude other than optimum to take advantage of a good tailwind (less time in the air = less fuel burned again)
So optimum is a 'still air value'
The 'Recommended' altitude in the FMC does consider these winds and adjusts it's, well, recommendation accordingly.
Other considerations that must be planned are, for example on the North Atlantic, you will usually (not always) have to fly on one of the daily established tracks and will be assigned an altitude. This may be significantly different than what you had planned for and you may burn more fuel as a result.
The altitudes you expect to fly can be pre inserted into the FMC for different points along the route, and it calculates a reasonably accurate prediction of arrival fuel based on this but it needs accurate information, plans and clearances can change affecting this drastically !
Incidentally, the computer (FMC) does not ask the Pilot for an optimum cruise altitude, once it has the Aircraft weight it tells him or her what that is.
Finally, the altitude you are cleared to fly will be set in the MCP
(mode control panel on the glareshield) and the autopilot, if engaged will level the Aircraft automatically at this altitude (if flying manually the Pilot will level it off themselves)
As you are progressively cleared higher you will change your cleared altitude in the altitude alert display of the MCP
You would not set the highest altitude you expect to fly.
Hope that makes sense !
The best contribution to safety is a competent Pilot.