What is the way to calculate the required twist of a flying wing?
Twist is closely coupled to the wing's sweep angle, airfoil camber, taper ratio and the desired level of static longitudinal stability. Other factors are the desired spanwise lift distribution and maneuverability. There is no simple, general formula: In the end twist, or, more precisely, local reflex camber, is the consequence of your selection of the parameters mentioned above. 

Background

Static longitudinal stability means that the aircraft will return to the trimmed angle of attack after a disturbance. This is made possible by producing proportionally more lift in the forward part of the wing than in the rear part. Reflex airfoils do it all by themselves and unswept flying wings do not need washout, but a proper reflex airfoil.

The Horten flying wings had highly tapered wings and used a bell-shaped lift distribution over span which produced a small downforce at the tips. This helped a lot to reduce adverse yaw and allowed them to do away with a vertical tail. Also this made stall chararcteristics benign. This lift distribution was reached by extensive washout (as much as 8°).

If you add stability by computer control, washout will not be needed and you can use an elliptical planform for best performance. This will, however, have unfavorable stall characteristics and needs wing fences when the wing is swept. Moderate sweep adds stability and damping, but above a critical combination of aspect ratio and sweep angle it is hard to achieve satisfactory stall characteristics.



Critical angle of sweep for swept wings, from Chapter 16 of S. Hoerner's Fluid Dynamic Lift. Too much aspect ratio and sweep will result in a strong pitch-up when the wing stalls.

By adding some chord at the outer wing you can twist the local incidence by the amount of chord added. This will lower the local lift coefficient and produce reserves at stall which will improve stall characteristics a lot. Karl Nickel has published a method for calculating the optimum planform for a given static stability with nearly elliptic lift distribution over a wide range of speeds. The key is his insight that by trimming the wing for a particular angle of attack the pilot will adjust local washout by moving the elevons trailing edge up. Ideally, the wing uses several elevons with increasing trim deflection towards the wingtip. (By "trimming" I do not only mean the reduction of stick forces, but also the adjustment of local lift to cancel any pitching moments.)

Note that now the planform is tightly coupled to the static margin and, consequently, to the location of the center of gravity (cg). Flying with a more forward location of cg than ideal means more negative elevon deflection angles and lower local lift at the tips than ideal, and vice versa.

The SB-13 flying wing glider uses this technique and has a taper ratio (ratio of tip to root chord) of 0.8. It uses two elevons over the outer 50% of span, the inner of which travels 1/3 of the trim deflection of the outer elevon. Twist is zero for the inner half of the wing, changes from 0° to -1.5° over the 0.15 m section where the root airfoil (HQ 34 N) changes over to the tip airfoil (HQ 36 K) to adjust for their difference in zero-lift angle and increases again linearly towards the tip to +0.5° (I hope I got that detail right, typing all this from memory). The negative washout was chosen to allow the elevons to have 4° twist themselves, so in sum (fixed wing and elevons) the wing has increasing twist towards the tips. In flight, the elevons will always have a slightly negative deflection, so the effective washout is even stronger.



SB-13 in flight (picture source)

To answer your questions directly:


  Is (a) twist needed?


Not necessarily. An unswept flying wing does not benefit much from twist. It will only help to add some stall margin at the tips. A positively swept flying wing can also get away without twist if the airfoil is changed over span from positive camber at the root to negative camber at the tip. If the same airfoil is used over the whole span, twist/reflex camber is necessary and cannot be avoided as soon as the cg is ahead of the neutral point: It will result from trimming the wing for the desired angle of attack.


  How do I to calculate it?



Select your desired static margin.
Select your desired lift distribution over span. An elliptic distribution will result in the lowest induced drag, and a bell-shaped distribution will give better maneuverability.
Select the planform that results in the desired lift distribution when trim changes over speed are considered. Use several elevons over span to be able to adjust the local incidence independently.
Twist is then a necessary consequence of trimming the aircraft.