Define $u(x)=E^x\int_0^\tau X_s ds$, then $u$ satisfies $\sigma^2 u_{xx}/2-\mu u_x=-x$ with boundary condition $u(b)=0$ and $u(\infty)=\infty$. (This is missing a boundary condition, but a good way to discover the extra boundary condition at $b$ is to solve first in a strip and then take the width of the strip to infinity). Now solve the PDEODE (solution is explicit). When $f$ is involved, replace RHS of ODE by $f(x)$. I am not sure this is research level question.