Ok luckiliy for you Dirk Eddelbuettel and Romain Francois wrote an awesome tool called Rcpp that will do all the (very) hard work for you. Install the package, read the vignettes et enjoy reusing all the example code available on Rcpp Gallery
There is even an example of how to use bigmemory
in conjunction with Rcpp
here