You need to insert an <img> node into your rich text as follows:
<img xmlns="http://www.w3.org/1999/xhtml" src="msoinline/identifier" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"
xd:inline="img data" />
You can also include a style="" attribute if you like.
I haven't been able to find any good information on how identifier is determined, but from my experimentation, it seems like InfoPath doesn't care as long as it's a non-empty string of letters and numbers. img data is the image's bytes in Base-64 encoding. If you're having the user attach the image via a Picture control, you can take the string right from there. If you're loading the bytes from somewhere outside the form, you should be able to use the framework function Convert.ToBase64String()