I've found equations for the $12\times12$ symmetric stiffness matrix for an element of a frame (a truss with welded joints): http://what-when-how.com/the-finite-element-method/fem-for-frames-finite-element-method-part-1/ second-to-last equation, $\textbf{k}_e=[\cdots]$.
However, that assumes the area-moment-of-inertia tensor is diagonal (i.e., that the beam can have an anisotropic section, but the anisotropy must be axis-aligned). In the general case, there's an additional $I_{yz}$ term, but it's not clear where it goes. I'm guessing it goes in the $(v, \theta_y)$ and $(w, \theta_z)$ entries scaled by $3E/2a^2$ and in the $(v,w)$s and $(w,v)$s scaled by $3E/2a^3$, but for all of those, It's not clear to me what the signs would be.