How would you add baseboard trim to an angled wall?
I'd get a 2 x 4, trim it to fit the length and height of your trim piece and screw it in.  

The horizontal lines are the piece of trim that will run along the outside of the staircase.