First you will need form which will pass some variables like NodeID of article, ClassID of comment to /content/action module. You can look on design/base/override/templates/full/article.tpl. There already is such code.
You will have to set right permission to Anonymous user, for content create and content edit.
template for comment edit, you can find in design/base/override/templates/edit/comment.tpl