It's usually thought that the traditional notion of usury was that of lending out money at interest. This is not incorrect if it's understood in a very specific way; but from the High Middle Ages to the Early Modern period, at least, the standard view was not that usury is any sort of lending at interest but that it is "when gain is sought to be acquired from the use of a thing not fruitful in itself, without labor, expense, or risk on the part of the lender." I say the 'standard view'; there were actually quite a few variations both leading up to this particular formulation (established by the Fifth Lateran Council in 1515) and afterward. But the basic idea was that the mere fact of loaning something gives no automatic right to charge interest on the loan; money on its own never carries an intrinsic title to interest, although under particular circumstances there can be extrinsic titles to interest; and thus usury consists in acting as if one had a right to treat borrowers a certain way when one has no such right, treating the loan as carrying a title to interest when it has no such title. And it certainly was the case that moral philosophers and theologians were very, very picky about what counted as a title to interest. But the entire late Medieval period was a period of considerable economic change, and that final clause of the Lateran interpretation of usury, "without labor, expense, or risk," turn out continually to require more careful specification as new means and ways of making money developed and as it became easier and easier to make loans of very different kinds. If we were to allow ourselves to give a rough, crude summary of how our modern finanical institutions, one way to describe this history would be to say that it was a sort arms race between moral philosophers and moral theologians on the one hand and usurers on the other as increasing economic prosperity changed the typical ways loans worked; a race in which the usurers kept finding new ways to skim profit from loans and the moral philosophers kept refining their classifications in order to sort out legitimate profit from genuine usury. It was an arms race that the usurers effectively won.
The key instrument by which the moral philosophers made sense of the new economic world was by this idea of titles to interest. An intrinsic title to interest would mean that, in and of itself, a loan would allow for interest. The medieval position was very firm here, drawing from both its theological and philosophical sources: money does not breed. It carries no intrinsic potential for profit, and it is immoral and unnatural to treat it as if it did -- 'unnatural', indeed, is the word they often used for it. I have here and there seen arguments that in our modern economy money is somehow different from what it was in the medieval period, so that now it does carry an intrinsic title to interest; but this is not a reasonable position at all, for it would mean that lenders would have the right to charge borrowers interest even if the borrowers had never contractually committed to paying the interest: if you just lent someone five dollars in a casual transaction, and there was intrinsic title to interest, then you could arbitrarily choose to start charging them interest, simply on the basis of the fact that you loaned it to them, even if you had never mentioned that you were going to do so. Clearly there is no reasonable way this could work; money does not carry any sort of automatic percentage of interest so that you can only charge a particular amount of interest, nor does it carry any special timeline to restrict you to charging interest only monthly rather than (say) by the minute, so far from serving as the foundation for a rational lending system, taking money to have an intrinsic title to interest would be the foundation for an utterly insane and arbitrary system in which borrowers were totally at the mercy of lenders.
So that leaves only extrinsic titles to interest. Extrinsic titles to interest do not derive from the loan itself but more generally from the common good. Because they are dependent on the common good, they are also sharply limited by it. More precisely, extrinsic titles to interest did not run afoul of the principles of justice because justice (in financial matters) is fair and equally beneficial exchange, and the extrinsic titles to interest existed precisely to equalize the benefits of the exchange. Lending is a risky business in many ways, so it's very easy for the lender to lose out in some way in a loan; and borrowing is also a risky business, but sometimes a very necessary one, and so there need to be standards in place so that borrowers don't tend to lose out but can still find lenders from whom they can borrow. This is an extraordinarily complicated problem that took all the ingenuity of some the most brilliant minds of the High Middle Ages and Renaissance, and led both to some clever analysis of banking practices and to the invention of entirely new financial institutions, like the montes pietatis, the forerunners of both pawn shops and modern banks. (Indeed, a few of the oldest European banks and pawn shops started out as montes pietatis founded by Franciscan theologians who have since been canonized as saints.)
There was no general unanimity about legitimate extrinsic titles of interest, although virtually everyone agreed they existed. And the discussions are greatly complicated by the rivalry between the Dominicans, who tended to take a much more conservative view of what could be allowed, and the Franciscans, who tended to be much more generous and adventuresome in their views on the subject. But five kinds of extrinsic title were often proposed as legitimate reasons for taking interest on a loan:
(1) lucrum cessans
(2) damnum emergens
(3) poena conventionalis
(4) praemium legale
(5) periculum sortis
Damnum emergens was probably the one that was least controversial and most widely accepted. The idea is basically that in certain kinds of loans it is clear that in the very fact of doing the lending the lender is taking damages. We're not talking about hypothetical harms; sometimes the lender is incurring harm or expense by the very fact of doing the lending. Thus the Franciscans argued that it was fine for a mons pietatis to charge interest on a loan if the interest were for the clear and carefully defined purpose of covering the operating expenses of the institution. Obviously simply to lend at zero interest while simultaneously paying your employees is not, as we would say, a sustainable business model, so there was a damage incurred in the fact of lending in the first place, one that allowed for legitimate compensation.
Somewhat more controversial was lucrum cessans. Sometimes lending, even lending that does not involve any particular sort of actual damage to the lender, means that the lender is losing out on profit that he would have certainly had if he had not done the lending. It's important to be careful here, because we tend to have a very generous notion of how this would work, but the scholastics did not. Many of the early scholastics did not even think that it was possible to be certain of counterfactual profits, the profits you would have had if you had done something differently. However, as lending became more stable, people began to allow that in some cases it was sufficiently certain that the lender was losing out on profit due to making the loan. An obvious case would be if the lender actually pulled mony out of a profit-making venture to make the loan. But it was never accepted that you could simply stipulate that you would have made profit on the money you were lending; you had to have specific reasons leading to certainty for practical purposes that you were losing out on legitimate profits by lending.
I have seen arguments that in our current financial system loans almost always carry extrinsic title of damnum emergens and lucrum cessans. I think this is transparently false if you actually look at the circumstances surrounding most loans, and the arguments otherwise are equally transparent attempts to get answers that had already been predetermined. But even if it were true, it would not justify our current systems of interest. Damnum emergens only allows you to break even on the particular loan you are making; and lucrum cessans only allows you to keep your profits from other ventures relatively stable over the duration of the loan -- one might think of it as a different sort of breaking even. They keep lending from being a bad situation for the lender, but that's it. You can't make a profit from lending itself if these are your only titles to interest. In fact, damnum emergens and lucrum cessans were very carefully and deliberately formulated to prevent them from being used as justifications for profits on mere lending.
The other three allow a tiny bit more wiggle room. Poena conventionalis is an interest, determined by contract between borrower and lender, that compensates for inconveniences the lender will be likely to experience if the borrower fails to return the loan by a certain period of time. That is, the borrower agrees to pay an additional percentage beyond the loan itself if his payment is not timely, due to the fact that his delay (mora) would hurt the lender in some way. You can see that we are slowly getting less concrete in these extrinsic titles: damnum emergens and lucrum cessans compensate for harms you have reason to think are actually being occurred in the very loan itself. Poena conventionalis is for a harm that one has reason to think will occur if certain conditions aren't met. But it's still anchored: you really do have to have reason to think that you will be hurt in some way by the delay, and you can't charge interest on the loan until the delay actually occurs.
Praemium legale, on the other hand, is much more indirect. Moral theologians and philosophers who were dealing with the problems of the emerging banking industry began to realize that the common good was genuinely improved if you had people who were willing to lend to those who for some reason needed to borrow. Thus lending was to that extent a civic activity that should be encouraged, at least within certain bounds. So it was occasionally suggested that the government, when it saw that lending needed to be encouraged, could allow a certain amount of interest on loans generally in order to provide an incentive for engaging in the risky and occasionally expensive business of lending. Obviously there were some people who thought that this was just giving the store away; but those who proposed it as a legitimate title to interest seem typically to have regarded it as a fairly restricted thing, and it's easy enough to see why. If you are trying to encourage actual lending, you can't make the incentive to lenders so great that borrowers no longer want to borrow, however desperate they are. You need to find a level of incentive that won't be a serious disincentive for borrowers. Since the point of the whole title is to serve the common good, you can't have an incentive that in general leaves borrowers worse off -- for instance, it would be self-defeating from the point of the common good law serves if you gave the lenders an incentive that regularly drove borrowers into bankruptcy and poverty. To be a just exchange, a loan has to leave both lender and borrower better off, allowing, of course, for the fact that sometimes unforeseeable events can make this impossible through no real fault of either the lender or the borrower. The tendency of the loans has to be in some way to the benefit of both parties, because only if your lending system has general tendency to improve everyone's life can it be said to be conducive to the common good, and it is only to the extent that lending is conducive to the common good that praemium legale can be a title to interest. (Some Catholics today worry about interest on savings accounts and the like, and wonder whether it violates the prohibition on usury. There's certainly nothing wrong with refusing to take interest on such things, as Dorothy Day did; but if praemium legale is a legitimate title to interest, the very small amount of interest on such accounts, which mutually benefits both parties and encourages both saving and lending, would certainly fall under it.)
One of the trickiest issues involved in lending is the defaulting of loans. None of the other titles to interest do much to handle this very risky part of lending, especially in the case where the default is real, that is, where the borrower no longer has the means to pay the loan. If the above titles were all that were involved, lenders would simply have to take the damage of defaulted loans: it's unjust and oppressive to squeeze money deliberately from those who can't afford to give it to you, so if a borrower suddenly comes into serious and unavoidable expenses (medical bills would probably be the modern example), trying to continue to collect the loan would be unjust and oppressive. Because of this, some moral philosophers suggested that periculum sortis, the chance that the loan might never be paid back, could be considered a legitimate title to interest, a way of limiting the danger posed by sheer bad luck. Such a title is rather dangerous, in the sense that it is difficult to pin down precisely. Not every borrower is equally likely to default; not every loan is equally damaging if never repaid; not every lender is equally endangered by defaults. So this title would require careful consideration of circumstances, and obviously would involve a great deal more approximation than the other titles. Because of this, those who allowed this title to interest tended to put serious restrictions on it, to prevent it from being used as a sneaky way of skimming money off of people.
So the prohibition of usury did not absolutely prevent the charging of interest; interest could be charged if you had a legitimate title to it. It was never assumed, of course, that the lender had an automatic right to charge interest; and it would have seemed utterly absurd to the moral philosophers and theologians who discussed the matter that a contract that in fact tended to harm the borrower could possibly be regarded as acceptable by a right-minded person. If Bernardino of Siena or Antonino of Florence were alive today, they would not condemn every kind of interest that we charge. But it is pretty clear that they would be horrified out our easy acceptance of kinds of interest that harm people who are already poor or in need, at our complete failure to hold interest-charging institutions to the standard of actually showing that they have the right to charge the interest they do on the loans they make, and would insist that Christians not sit around and simply accept it as the way of things, but use their ingenuity and reason to develop new kinds of institutions that would be more suitable to the common good.
And I rather suspect that in this age of lukewarm and lazy Laodicea their plea for this inventiveness and creativity would fall into the void.
John Wilkins asked for some further online reading. The study of scholastic economic thought is relatively hopping, and constantly changing, so it's tricky to find works that are both accessible online and not outdated. Indeed, I can't guarantee that the above is anything more than an approximation, since someone somewhere might have come up with a better way of looking at this or that point by looking more closely at heretofore overlooked or misunderstood passages. In addition one has to be somewhat careful with the online works; many of the works online that discuss the matter discuss it entirely from the perspective of one modern school of economics, which can lead to a somewhat selective reading of the texts. But even the outdated material is sometimes good for at least getting the basic terminology and issues down. As for primary sources, there are a few of them online, but not very many.
The Montes Pietatis, Interest, and Usury articles from the old Catholic Encyclopedia
The SEP article on Gregory of Rimini briefly discusses his economic thought in section 6
Thomas Aquinas on the sin of usury. St. Thomas allows damnum emergens, but that's about it; later theologians often interpreted him a bit more loosely in order to get various practices in, but Thomas's hard line on the subject is one reason for the fact that the Dominicans tended to be more conservative on the subject.
Session X of the Fifth Lateran Council
Benedict XIV, Vix Pervenit (1745)
Brian McCall, Unprofitable Lending: Modern Credit Regulation and the Lost Theory of Usury (PDF)
Robert Mochrie, Justice in Exchange: The Economic Philosophy of John Duns Scotus
George Augustine Thomas O'Brien, An Essay on Mediaeval Economic Teaching
Owen Aloysius Hill, Ethics, General and Special. This and the previous are somewhat dated in their discussions of usury and interest, but still decent enough for getting a sense of the terminology and issues.
A lot of the late medieval and early modern scholastic work is associated with the School of Salamanca; Marjorie Grice-Hutchinson's The School of Salamanca is still after all this time a good first introduction to Salamanticensic economic theory, although I can't find it online. And Eric Kerridge's Usury, Interest, and the Reformation does a good job of assembling relevant sources.
Incidentally, the most famous philosophical defense of usury (on the grounds that people have a right to enter into any monetary contracts they please) is that of Jeremy Bentham; which is perhaps worth noting, since outright defenses of usury as moral are very, very rare.