Here are some relevant quotes:
First, Luther discusses 'two kinds of righteousness', the 'alien righteousness' (a righteousness from outside us, i.e. from God) that 'swallows up our sin' by grace alone (justification), and the 'proper righteousness' of a life spent in good works which are the fruit of justification:
'Through faith in Christ, therefore, Christ’s righteousness becomes our righteousness and all that he has becomes ours; rather, he himself becomes ours. Therefore the Apostle calls it ‘the righteousness of God.’ in Rom. 1:17: For in the gospel ‘the righteousness of God is revealed...as it is written, “The righteousness man shall live by faith.” ’...This is an infinite righteousness, and one that swallows up all sin in a moment, for it is impossible that sin should exist in Christ. On the contrary, he who trusts in Christ exists in Christ; he is one with Christ, having the same righteousness as he...Therefore this alien righteousness, instilled in us without our works by grace alone—while the Father, to be sure, inwardly draws us to Christ—is set opposite original sin, likewise alien, which we acquire without our works by birth alone.
The second kind of righteousness is our proper righteousness, not because we alone work it, but because we work with that first and alien righteousness. This is the manner of life spent profitably in good works, in the first place, in slaying the flesh and crucifying the desires with respect to the self, of which we read in Gal. 5:24: ‘And those who belong to Christ Jesus have crucified the flesh with its passions and desires.’ In the second place, this righteousness consists in love to one’s neighbor, and in the third place, in meekness and fear toward God...This righteousness is the product of the righteousness of the first type, actually its fruit and consequence...This righteousness goes on to complete the first for it ever strives to do away with the old Adam and to destroy the body of sin. Therefore it hates itself and loves its neighbor; it does not seek its own good, but that of another, and this its whole way of living consists. For in that it hates itself and does not seek its own, it crucifies the flesh. Because it seeks the good of another, it works love. Thus in each sphere it does God’s will, living soberly with self, justly with neighbor, devoutly toward God.' Martin Luther, from Two Kinds of Righteousness in 'Martin Luther’s Basic Theological Writings' (Minneapolis: Fortress, 1989), pp. 156–158).
Now Melanchthon touches upon the apparent conflict between Paul and James (often cited by the objectors) while emphasing that a true, living faith never fails to bring forth good works:
'Paul is here (1 Corinthians 12–13)...demanding love in addition to faith. This is what he does elsewhere in all his letters, demanding good works from believers, i.e. the justified...And when he says that he who has all faith but no love is nothing, he is right. For although faith alone justifies, love is also demanded...But love does not justify because no one loves as he ought. Faith, however, justifies...There is also the passage in James 2:17: ‘So faith by itself, if it has no works, is dead.’ He did well to say this, for he was reprimanding those who thought that faith is merely a historical opinion about Christ. For just as Paul calls one type of faith ‘true,’ and the other ‘feigned,’ so James calls the one kind ‘living’ and the other ‘dead.’ A living faith is that efficacious, burning trust in the mercy of God which never fails to bring forth good fruits. That is what James says in ch. 2:22: ‘Faith was completed by works.’...Therefore, the whole point that James is making is that dead faith...does not justify, but a living faith justifies. But a living faith is that which pours itself out in works. For he speaks as follows (v. 18): ‘Show me your faith apart from your works, and I by my works will show you my faith.’ But he does not say: ‘I will show you works without faith.’ My exposition squares most harmoniously with what we read in James: ‘So faith by itself, if it has no works, is dead.’ Therefore, it is obvious that he is teaching here merely that faith is dead in those who do not bring forth the fruit of faith, even though from external appearances they seem to believe.' Philipp Melanchthon, from Loci communes theologici, in The Library of Christian Classics (Philadelphia: Westminster, 1969), Volume XIX, p. 112.
And finally we offer the Augsburg confessors' succinct summary of the Lutheran teaching:
'[Our churches] teach that this faith is bound to bring forth good fruits, and that it is necessary to do good works commanded by God, because of God's will, but that we should not rely on those works to merit justification before God. For remission of sins and justification is apprehended by faith, as also the voice of Christ attests: When ye shall have done all these things, say: We are unprofitable servants. Luke 17:10. The same is also taught by the Fathers. For Ambrose says: It is ordained of God that he who believes in Christ is saved, freely receiving remission of sins, without works, by faith alone. The Augsburg Confession, Article VI, 'Concerning the New Obedience'.
Alles klar, ja?!
If there are examples of individuals for whom the Lutheran doctrine of justification by faith alone militates against a life of good works, the cause is certainly not the Reformers' doctrine, but, I suggest, the flesh of the old Adam who stubbornly resists the leading of the Spirit.