We demonstrate a microscopy technique that extracts tensorial information about the second-order nonlinear optical susceptibility and hyperpolarizability of molecular materials. Our technique is based on polarization-dependent second-harmonic generation and a genetic algorithm, using which the best possible match with the measured data, and the possible susceptibility tensor components are found. In contrast to existing techniques, which access only the magnitude of the nonlinear response, our technique also provides information about the phase of the tensor components, which is associated with molecular resonances. After verifying the technique using simulated model structures with well-known symmetries, we demonstrate its capabilities using model surface samples consisting of single purple membrane (PM) fragments of bacteriorhodopsin (bR) chromoproteins. Since the supramolecular structures of PM, bR, and photoactive retinal molecules are known, complex-valued tensorial information on the molecular hyperpolarizabilities can also be extracted. Our technique opens new possibilities for obtaining detailed structural information on biomolecular samples with microscopic resolution.