The aim of this paper is to study the law of the last passage time of a linear diffusion to a curved boundary. We start by giving a general expression for the density of such a random variable under some regularity assumptions. Following Robbins & Siegmund, we then show that this expression may be computed for some implicit boundaries via a martingale method. Finally, we discuss some links between first hitting times and last passage times via time inversion, and present an integral equation (which we solve in some particular cases) satisfied by the density of the last passage time. Many examples are given in the Brownian and Bessel frameworks.