You must use the EM_GETOLEINTERFACE message to obtain the RichEdit's IRichEditOle interface and the EM_SETOLEINTERFACE message to register an IRichEditOleCallback interface that the control uses to obtain the Ole data.
To do an animated GIF is much the same (you must decode the GIF into its component bitmaps, which is somewhat involved but not difficult, and you can get an actual GIF LZW decoder algorithm by searching the web; or you can find a library that does it for you...).
The main difference is that you will need to periodically update the bitmap displayed.
I've never done this myself, so I don't know of anyone who has... a little googling might get some useful tips.