The circuit below allows Vout control using either PWM or an analog voltage.
R#/C1 form a low pass filter to convert PWM to DC.
To get low ripple it is usually desirable to have the filter corner frequency much lower than the PWM frequency. For more rapid response I often use a Bessel filter in this role. A 3 pole Bessel can be implemented with 1 opamp section and a 5 pole with 2 opamps. If a quad opamp is used the end result is cheap and compact.
IC1 acts as a comparator, comparing the user provided control voltage with voltage from the divided output voltage. An opamp can typically be used in this role without problems. IC1 here provides high/low output and this action is usually acceptable to SMPS ICs. If desired IC1 could be configured as a finite gain amplifier, allowing analog control of the FB pin, but this level of sophistication is not usually required.
simulate this circuitsimulate this circuit – Schematic created using CircuitLab