The joint posterior of latent variables and parameters in Bayesian hierarchical models often has a strong nonlinear dependence structure, thus making it a challenging target for standard Markov-chain Monte-Carlo methods. Pseudo-marginal methods aim at effectively exploring such target distributions, by marginalizing the latent variables using Monte-Carlo integration and directly targeting the marginal posterior of the parameters. We follow this approach and propose a generic pseudo-marginal algorithm for efficiently simulating from the posterior of the parameters. It combines efficient importance sampling, for accurately marginalizing the latent variables, with the recently developed pseudo-marginal Hamiltonian Monte Carlo approach. We illustrate our algorithm in applications to dynamic state space models, where it shows a very high simulation efficiency even in challenging scenarios with complex dependence structures.