It's quite similar to 2D space. Consider a vector $v = B-A$ which you can imagine is the direction from $A$ to $B$. Hence for any point $C$ between $A$ and $B$ (inclusive of $A$ and $B$).
$$C = A + tv$$
where $t = 0$ implies $C = A$ and $t = 1$ implies $C = B$ and $t \in (0,1)$ are all the points in between (one of which is the desired $C$). As you can see, this representation is independent of the dimension of your space.
So, what's the value of $t$? Well, let the known distance from $A$ to $C$ be $d_{AC}$. Now, the distance between $A$ and $B$ or $d_{AB}$ is the magnitude of $v$ or $|v|$ which is nothing but
$$d_{AB} = |v| = \sqrt{(a_x-b_x)^2+(a_y-b_y)^2+(a_z-b_z)^2}$$
(You can see that this formula for the Euclidean distance between two points is similar in 2D as well)
Therefore, $t = \large \frac{d_{AC}}{d_{AB}}$ and substituting $t$ and $v$ in the previous formula for $C$, we have:
$$C = A + \frac{d_{AC}}{\sqrt{(a_x-b_x)^2+(a_y-b_y)^2+(a_z-b_z)^2}}(B-A)$$
As David K mentions, there are infinitely many rotations that map $\bf a$ to $\bf b$: Given any such rotation $R$, for a rotation $S$ about $\bf b$ by an arbitrary angle, $S \circ R$ is also a rotation that maps $\bf a$ to $\bf b$, and so there is a circle's worth of such rotations.
If the vectors $\bf a$ and $\bf b$ are linearly independent, however, then we can pick out a preferred rotation, namely the one that fixes ${\bf a} \times {\bf b}$ (equivalently, the unique rotation that preserves the plane spanned by $\bf a$ and $\bf b$ as well as the orientation of that plane).
Here's one way to construct the matrix corresponding to this preferred rotation: First, notice that we may as well normalize $\bf a$ and $\bf b$, that is, replace them respectively by the unit vectors $\frac{\bf a}{|{\bf a}|}$ and $\frac{\bf b}{|{\bf b}|}$.
The vector
$${\bf n} := \frac{{\bf a} \times {\bf b}}{|{\bf a} \times {\bf b}|}$$ has unit length and is orthogonal to $\bf a$, and hence ${\bf a}$ and ${\bf b}$ together determine an oriented, orthonormal basis of $\Bbb R^3$, namely,
$$({\bf a}, {\bf n} \times {\bf a}, {\bf n}).$$
In particular, the matrix
$$\begin{pmatrix}{\bf a} & {\bf n} \times {\bf a} & {\bf n}\end{pmatrix}$$
defines a rotation, namely the one that sends the standard basis $({\bf e}_1, {\bf e}_2, {\bf e}_3)$ to the above basis, and its inverse does the reverse.
Now, by symmetry,
$$({\bf b}, {\bf n} \times {\bf b}, {\bf n}).$$
is also an oriented, orthonormal basis, and the corresponding matrix built by adjoining these (column) vectors sends the standard basis to this one.
Putting this together with the inverse mentioned above maps $({\bf a}, {\bf n} \times {\bf a}, {\bf n})$ to the standard basis $({\bf e}_1, {\bf e}_2, {\bf e}_3)$ and then the standard basis to $({\bf b}, {\bf n} \times {\bf b}, {\bf n})$, that is, by construction
$$\begin{pmatrix}{\bf b} & {\bf n} \times {\bf b} & {\bf n}\end{pmatrix}\begin{pmatrix}{\bf a} & {\bf n} \times {\bf a} & {\bf n}\end{pmatrix}^{-1}$$
is a rotation matrix that maps $\bf a$ to $\bf b$ and fixes $\bf n$ (and hence ${\bf a} \times {\bf b}$). (Since the inverted matrix $\begin{pmatrix}{\bf a} & {\bf n} \times {\bf a} & {\bf n}\end{pmatrix}$ is orthogonal, its inverse is just its transpose, saving considerable computation.)
One can of course expand this expression to find explicit formulas for the entries of the resulting matrix in terms of the components of $\bf a$ and $\bf b$, but I doubt that this would simplify nicely.
Best Answer
Let's say you know one vertex of the cuboid, $\vec{o}$, and three adjacent vertices $\vec{a}$, $\vec{b}$, and $\vec{c}$: $$\bbox{\vec{o} = \left[\begin{matrix} o_x \\ o_y \\ o_z \end{matrix}\right]} ,\quad \bbox{\vec{a} = \left[\begin{matrix} a_x \\ a_y \\ a_z \end{matrix}\right]} ,\quad \bbox{\vec{b} = \left[\begin{matrix} b_x \\ b_y \\ b_z \end{matrix}\right]} ,\quad \bbox{\vec{c} = \left[\begin{matrix} c_x \\ c_y \\ c_z \end{matrix}\right]}$$ All edges of the cuboid (where two faces meet) match one of the vectors $$\bbox{\vec{e}_a = \vec{a} - \vec{o}} , \quad \bbox{\vec{e}_b = \vec{b} - \vec{o}} , \quad \bbox{\vec{e}_c = \vec{c} - \vec{o}}$$ and the eight vertices of the cuboid are at $$\begin{array}{rll} \vec{v}_{000} =& \vec{o} & = \vec{o} \\ \vec{v}_{001} =& \vec{o} + \vec{e}_a & = \vec{a} \\ \vec{v}_{010} =& \vec{o} + \vec{e}_b & = \vec{b} \\ \vec{v}_{011} =& \vec{o} + \vec{e}_a + \vec{e}_b & = \vec{a} + \vec{b} - \vec{o} \\ \vec{v}_{100} =& \vec{o} + \vec{e}_c & = \vec{c} \\ \vec{v}_{101} =& \vec{o} + \vec{e}_a + \vec{e}_c & = \vec{a} + \vec{c} - \vec{o} \\ \vec{v}_{110} =& \vec{o} + \vec{e}_b + \vec{e}_c & = \vec{b} + \vec{c} - \vec{o} \\ \vec{v}_{111} =& \vec{o} + \vec{e}_a + \vec{e}_b + \vec{e}_c & = \vec{a} + \vec{b} + \vec{c} - 2 \vec{o} \\ \end{array}$$ The centroid for a cuboid (or a parallelepiped; the three edges do not need to be perpendicular to each other) is the sum of the vertex coordinates, divided by eight. If you sum the above, you'll find out that the centroid is at $\vec{p}$, $$\bbox{\vec{p} = \frac{1}{2}\left( \vec{a} + \vec{b} + \vec{c} - \vec{o} \right) = \left[\begin{matrix} \frac{a_x + b_x + c_x - o_x}{2} \\ \frac{a_y + b_y + c_y - o_y}{2} \\ \frac{a_z + b_z + c_z - o_z}{2} \\ \end{matrix}\right]}$$