Method pointed out by Sid:
By Law of Conservation of Energy: The initial momentum of the eject
is equal to the final momentum of fuel and rocket combined. That mass
will be $M+m_b$ and it will have a common velocity.
You can take the final velocity of the combined mass of fuel and the
rocket as $v$. So: $$p_{fuel} = v(m_b + M)$$ $$Mu_0 = v(m_b + M)$$
$$\therefore v = \frac{Mu_0}{m_b+ M}$$
This method pointed out by Sid is a very useful method in cases when the whole mass is transferred to the body instantaneously.
However let us consider a tad bit more complicated case which is exactly why I am putting down this answer :
Suppose the ejected mass enters B with a rate of $\alpha $ $kgs^{-1}$
Now how do we find the velocity of the rocket at a time when some of the mass of fuel is transferred to the rocket while some is still left?
Firstly the velocity in this case will be variable and hence a function of time.Let us consider that we want to calculate the velocity at a time instant $'t'$.Let velocity at this instant be $v_b$.Now in this time total mass of fuel that has entered into B is $\alpha t$ .This mass initially had a velocity $u_0$ but after entering B it has common velocity $v_b$. .So final momentum of this mass of fuel and rocket is : $(\alpha t + m_b)v_b$.
Final momentum of rocket + fuel = initial momentum of rocket + fuel(By Law of Conservation of Momentum) .... 1
So
Initial Momentum of rocket = 0 (since velocity os 0)
Initial Momentum of fuel = $\alpha t u_0$
Initial momentum of rocket + fuel system = 0 + $\alpha t u_0$ = $\alpha t u_0$
Final momentum of this mass of fuel and rocket is : $(\alpha t + m_b)v_b$.
from 1 above :
$$ \alpha t u_0 = (\alpha t + m_b)v_b$$
$$ v_b = \frac{\alpha t u_0}{\alpha t + m_b}$$
Which is my answer