You should be able to do this efficiently using LAPACK/BLAS, using the QR factorization [geqrf], orthogonal multiplication [ormqr], and triangular solve [trsm] routines. LAPACK and BLAS place a lot of emphasis on economy of storage, so many of these algorithms operate in-place, overwriting their inputs with their outputs (geqrf, ormqr and trsm all work like this).
You should start off with geqrf, it will overwrite $\mathbf B$ with both $\mathbf Q$ and $\mathbf R$. The $\mathbf R$ output is just tabulated directly into the upper triangle, but $\mathbf Q$ is represented compactly in "reflector form". This representation requires a small/vector-sized amount of additional workspace ($\mathbf \tau$), empty storage that you provide to geqrf, that it will fill upon exit. You need to hang onto $\mathbf \tau$ to do anything else with $\mathbf Q$.
Because $\mathbf Q$ is stored in that special/reflector form, you can't just use BLAS/gemm to apply it. Instead you should use the LAPACK routine ormqr, it can apply $\mathbf Q$ to $\mathbf A$ from either the left or right and also apply transposition. It also operates inplace, overwriting $\mathbf A$ with (eg) $\mathbf Q^T \mathbf A$ or $\mathbf A \mathbf Q$. This can make it a little tricky to reason about, because (eg) $\mathbf Q^T \mathbf A$ and $\mathbf A$ are not necessarily the same size ($\mathbf Q$ being tall/skinny). Nevertheless you should be able to use two calls to ormqr (from the 'L'eft with a 'T'ranspose, then from the 'R'ight with 'N'otranspose) to get $\mathbf C = \mathbf Q^T\mathbf A\mathbf Q$ overwritten into the upper left corner of your original $\mathbf A$.
The last step, forming $\mathbf R ^{-1} \mathbf C \mathbf R^{-T}$ can be accomplished using the BLAS routine trsm. It applies the inverse of a triangular system, overwriting the input $\mathbf C$ with (eg) the output $\mathbf R^{-1} \mathbf C$. It can apply $\mathbf R$ from the left or right, and also apply a transposition to it. You'll need two calls, one from the 'L'eft with 'N'otranspose, then another from the 'R'ight with 'T'ranspose. In both cases you'll want to use uplo='U'pper because that's where geqrf stores $\mathbf R$.
Unfortunately I am not a C# expert, but I would imagine there's some usual way to call native/unmanaged "extern C" libraries, that's where you'd want to start.