Using the Trojan horse method to investigate resonances above and below the threshold in nuclear reactions of astrophysical interest