The complaints you have described are suggestive of Vaginitis. Any infection or inflammation of the vagina is called vaginitis.It can be due to yeast,bacteria or chlamydia or it may be non infectious.Because different types of vaginitis have different causes, the treatment needs to be specific to the type of vaginitis present.
Following will help you:Avoid sex for few days.Use condoms in future.Don't doucheDo not wash around your vagina too often. Once a day is usually enough.Apply oint. Metronidazole vaginally.Prescription antibiotic course may be required. So I advice you to consult Gynaecologist for physical examination.
Hope this helped
Yes, vaginitis or pain during sex can be due to viral infection like herpes.You need physical examination from gynaecologist and treat accordinglly.
Hope this helped.