I would suggest you try to understand it in small steps.
Step 1: How to build a matrix for a rotation in 2D.
Try to figure out the elements a,b,c,d of a 2x2 matrix, such that
<br />
\left[ \begin{array}{c} x' \\ y' \end{array} \right] =<br />
\left[ \begin{array}{cc} a & b \\ c & d \end{array} \right]<br />
\left[ \begin{array}{c} x \\ y \end{array} \right]<br />
where the vector (x,y) represents a point before the rotation, and the vector (x',y') is the point after being rotated.
Step 2: Now in 3D, build a 3x3 matrix that represent a rotation for one of the Euler angles, that is, around one of the standard axes, either the X-, Y- or Z-axis.
http://en.wikipedia.org/wiki/Rotation_matrix" can help you, and has a lot of examples.
Step 3: Combine (multiply) 3 matrices, 3x3 each, to obtain one matrix that represent the combined rotation for the three Euler angles. Note that the order in which you combine them is important: in your example, when you speak of a rotation of "45,0,0", this is very clear only because there is just one rotation; if you had two or three, you would need to define in which order you perform the rotations.
Now, after Steps 1-3 you know how to get a point in the "normal" coordinate system, and transform it (rotate it) into Cube1's system. But you want the opposite! From Cube1 to the "normal" system. To do that, you use the inverse of that matrix.
What D H was telling you above is that rotation matrices belong to a group of matrices called "orthogonal", which have a very nice property: their inverse is simply the transposed matrix. Just turn rows into columns, and you have the inverse.