Seems they are pretty much interchangeable.
I can't think of a time to use one that I could not use the other.
.
I deny answering the question well.
I deny having answered the question well.
.
I flatly deny being involved.
I flatly deny having been involved.
.
The "having done" has a sense of something completed in the past. If you can think of a way that this is important, then you have a difference.
.
I deny doing the drawing. - a continuing action, in that it was not instantaneous.
I deny having done the drawing. - This "doing" is not completed. No sense of the dooing taking time.
.