Need an optocoupler for getting directly proportional output galvanically isolated from the DC input
A standard way to do this is to use a second optocoupler (preferably on the same chip) to compensate the non-linearity of the first one. The example below is from Analog Devices AN-106. The principle is to put a current through the second optocoupler's primary such that it secondary gives the same result as the secondary of the first optocoupler. Then that current must be the current through the first optocoupler's primary.



An IL300 optocoupler is a slight variation on this theme: it has two secondaries coupled to the same primary, so the primary side can do the compensation.



As Dirk suggests, you could go digital at the primary side. A digital signal is much easier to get through an isolation barrier. You don't have to build this yourself, check for instance the HCPL-7510 linear isolation amplifier :