Theory:
To put it very simple. All procedures (SID as well at missed approaches) are designed assuming normal operation. To use a certain procedure you have to meet the required climb gradients of the procedures with all engines operating. This decides your MTOW for departure. For landing it decides your MLW and/or the height of your minima, speed additives etc.
For some reason the missed approach is cause of a lot of confusion. The missed approach is no different that any other procedure design - it assumes all engines operating.
In case of an engine failure it's up to the operator to establish contingency procedures (in both cases). No published procedure will cover an emergency.
Practice:
In my company we would never fly the SID with an engine failure. According to surveys of the airports, we will have either a procedure to follow, or if obstacles don't require, we fly runway heading to MSA (Deviating from clearance - declare mayday and inform ATC). This is because the survey is runway specific. It doesn't account for 10 different departure routes where one or more may take you in the opposite direction of the airfield in to a mountain behind the runway.
If doing a single engine approach we use the engine out procedure according to the above.
Finally with an emergency the final responsibility rest with the commander (as always), and the commander may always decide differently (e.g. to continue visually).
Also remember that contingency procedures can't cover every conceivable scenario. You may get your engine failure at 3000' with the engine out procedure behind you... but will you make it above the 12000' peak ahead of you? This is where airmanship, situational awareness and local knowledge (or detailed study of the terrain if first time there) comes into play. Always have a plan.
Remember in an emergency no rules applies anymore. Only rule is that you have to assure the best possible outcome. The Hudson river landing after a double engine failure is a good example of that.