Yes, you should use createrawtransaction and appendrawtransaction for this.
Both A and B should first use preparelockunspentfrom to prepare the appropriate quantity for spending in an unspent transaction output. The corresponding txid+vout combination should be used by each as their input for the transaction being built in the createrawtransaction and appendrawtransaction calls respectively. Then B has to sign the full transaction using signrawtransaction before passing it back to A to do the same, and finally broadcasting it.
If you want to get more clever, you can actually do this with less back-and-forth, since A can build the partial transaction and then sign it with signrawtransaction using a sighashtype of ALL|ANYONE_CAN_PAY before passing the result to B for adding the new input and final signing.